Skip to content

android-com-pl/mobile-tab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0d15a9f · Sep 21, 2023

History

57 Commits
Sep 21, 2023
Sep 21, 2023
Aug 13, 2021
Jul 18, 2021
Jan 20, 2022
May 16, 2022
Jan 20, 2022
Jan 20, 2022
Jul 18, 2021
Aug 18, 2022
Sep 21, 2023
Jan 20, 2022

Repository files navigation

Mobile Tab Component

License Latest Stable Version Total Downloads

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/

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