mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
[PUI] Add theme changer to navbar (#7907)
* Add API bump * [PUI] Add theme setting to navbar Closes https://github.com/invenhost/InvenTree/issues/106 * Rename to the same as ColorToggle * Change action text Co-authored-by: @SchrodingersGat
This commit is contained in:
parent
5c9f50b43c
commit
286091c1e5
@ -1,13 +1,16 @@
|
||||
"""InvenTree API version information."""
|
||||
|
||||
# InvenTree API version
|
||||
INVENTREE_API_VERSION = 240
|
||||
INVENTREE_API_VERSION = 241
|
||||
|
||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||
|
||||
|
||||
INVENTREE_API_TEXT = """
|
||||
|
||||
v241 - 2024-09-18 : https://github.com/inventree/InvenTree/pull/7906
|
||||
- Adjusts required fields for the MeUserDetail endpoint
|
||||
|
||||
v240 - 2024-08-16 : https://github.com/inventree/InvenTree/pull/7900
|
||||
- Adjust "issued_by" filter for the BuildOrder list endpoint
|
||||
- Adjust "assigned_to" filter for the BuildOrder list endpoint
|
||||
|
@ -1,9 +1,18 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Group, Menu, Skeleton, Text, UnstyledButton } from '@mantine/core';
|
||||
import {
|
||||
Group,
|
||||
Menu,
|
||||
Skeleton,
|
||||
Text,
|
||||
UnstyledButton,
|
||||
useMantineColorScheme
|
||||
} from '@mantine/core';
|
||||
import {
|
||||
IconChevronDown,
|
||||
IconLogout,
|
||||
IconMoonStars,
|
||||
IconSettings,
|
||||
IconSun,
|
||||
IconUserBolt,
|
||||
IconUserCog
|
||||
} from '@tabler/icons-react';
|
||||
@ -20,6 +29,7 @@ export function MainMenu() {
|
||||
state.user,
|
||||
state.username
|
||||
]);
|
||||
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
|
||||
|
||||
return (
|
||||
<Menu width={260} position="bottom-end">
|
||||
@ -57,6 +67,15 @@ export function MainMenu() {
|
||||
<Trans>System Settings</Trans>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<Menu.Item
|
||||
onClick={toggleColorScheme}
|
||||
leftSection={colorScheme === 'dark' ? <IconSun /> : <IconMoonStars />}
|
||||
c={
|
||||
colorScheme === 'dark' ? vars.colors.yellow[4] : vars.colors.blue[6]
|
||||
}
|
||||
>
|
||||
<Trans>Change Color Mode</Trans>
|
||||
</Menu.Item>
|
||||
{user?.is_staff && <Menu.Divider />}
|
||||
{user?.is_staff && (
|
||||
<Menu.Item
|
||||
|
Loading…
Reference in New Issue
Block a user