Skip to content

refactor: use native Switch component for admin navigation settings - #64

Closed
huoxin233 wants to merge 1 commit into
linkrobins:mainfrom
huoxin233:feat/admin-switches
Closed

huoxin233 wants to merge 1 commit into
linkrobins:mainfrom
huoxin233:feat/admin-switches

Conversation

@huoxin233

Copy link
Copy Markdown
Contributor

Summary

Modernizes the admin navigation settings by replacing standard HTML checkboxes with Flarum's native <Switch> component.

Key Changes

  • Imported and used flarum/common/components/Switch in SupportAdminPage.tsx for navigation settings toggles.
  • Preserved existing reactive Mithril setting streams and default values.
  • Cleaned up the manual <label className="checkbox"> wrapper and literal whitespace.

Screenshots

Note that I am running the latest flarum 2.1 dev, so the layout may look slightly different from the current 2.0

Before:
PixPin_2026-11-05_14-07-37

After:
PixPin_2026-11-05_16-15-23

@karl-bullock

Copy link
Copy Markdown
Member

Thanks @huoxin233, I know this fits nicely with Flarum's native switch. I'm keeping the plain checkboxes on the admin page though; I decided that on the last round and want the admin screens to stay exactly as they are. Closing this one, but I appreciate you keeping at it.

@karl-bullock

Copy link
Copy Markdown
Member

Hi @huoxin233 — I changed my mind on this one, and you were right: the admin toggles should be Flarum's own Switch. I've done it in #72, and while I was in there I also replaced the raw checkboxes in the category editor's allowed-groups list with Switch rows, so the whole admin screen uses core controls.

Thanks for the nudge and for taking the time to put the PR together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants