acpl/mobile-tab

Installs: 473

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Language:TypeScript

Type:flarum-extension

1.0.5 2021-08-13 11:36 UTC

This package is auto-updated.

Last update: 2021-10-06 19:55:26 UTC


README

License Latest Stable Version Total Downloads Supports latest Flarum

A Flarum extension. Adds a bottom tab on mobile.

Imgur

Installation

Install with composer:

composer require acpl/mobile-tab:"*"

Updating

composer update acpl/mobile-tab:"*"
php flarum cache:clear

Extending

You can add, modify and delete items with your own extension. Read: https://docs.flarum.org/extend/extending-extensions.html#extending-extensions

Examples:

import { components } from '@acpl-mobile-tab';
import { extend } from 'flarum/common/extend';

const { MobileTab, MobileTabItem } = components;

export default () => {
  extend(MobileTab.prototype, 'items', (items) => {
    // Add new item
    items.add(
      'following',
      <MobileTabItem href={app.route('following')} icon="fas fa-star" label={app.translator.trans('my-ext.forum.my-item')} />,
      90
    );

    // Add new item using custom HTML
    items.add('my-item', <div>...This is my custom item</div>, 70);

    // Remove item
    items.remove('home');
  });
};

Links