mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-09 21:30:54 +00:00
fix theme refs
This commit is contained in:
@@ -59,7 +59,7 @@ export default function LayoutComponent() {
|
|||||||
//searchIcon={<IconSearch size="1.2rem" />}
|
//searchIcon={<IconSearch size="1.2rem" />}
|
||||||
//searchPlaceholder={t`Search...`}
|
//searchPlaceholder={t`Search...`}
|
||||||
shortcut={['mod + K', '/']}
|
shortcut={['mod + K', '/']}
|
||||||
//nothingFoundMessage={t`Nothing found...`}
|
nothingFound={t`Nothing found...`}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</ProtectedRoute>
|
</ProtectedRoute>
|
||||||
|
@@ -12,7 +12,7 @@ import { Link, useNavigate } from 'react-router-dom';
|
|||||||
import { doLogout } from '../../functions/auth';
|
import { doLogout } from '../../functions/auth';
|
||||||
import * as classes from '../../main.css';
|
import * as classes from '../../main.css';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import { theme } from '../../theme';
|
import { theme, vars } from '../../theme';
|
||||||
|
|
||||||
export function MainMenu() {
|
export function MainMenu() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -27,7 +27,7 @@ export function MainMenu() {
|
|||||||
{userState.username() ? (
|
{userState.username() ? (
|
||||||
userState.username()
|
userState.username()
|
||||||
) : (
|
) : (
|
||||||
<Skeleton height={20} width={40} radius={theme.defaultRadius} />
|
<Skeleton height={20} width={40} radius={vars.radiusDefault} />
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<IconChevronDown />
|
<IconChevronDown />
|
||||||
|
@@ -10,6 +10,7 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
UnstyledButton
|
UnstyledButton
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
|
import { useColorScheme } from '@mantine/hooks';
|
||||||
import { IconLayoutSidebar } from '@tabler/icons-react';
|
import { IconLayoutSidebar } from '@tabler/icons-react';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ import { menuItems } from '../../defaults/menuItems';
|
|||||||
import * as classes from '../../main.css';
|
import * as classes from '../../main.css';
|
||||||
import { useServerApiState } from '../../states/ApiState';
|
import { useServerApiState } from '../../states/ApiState';
|
||||||
import { useLocalState } from '../../states/LocalState';
|
import { useLocalState } from '../../states/LocalState';
|
||||||
import { theme } from '../../theme';
|
import { theme, vars } from '../../theme';
|
||||||
import { InvenTreeLogo } from '../items/InvenTreeLogo';
|
import { InvenTreeLogo } from '../items/InvenTreeLogo';
|
||||||
import { MenuLinks } from '../items/MenuLinks';
|
import { MenuLinks } from '../items/MenuLinks';
|
||||||
|
|
||||||
@@ -34,6 +35,7 @@ export function NavHoverMenu({
|
|||||||
]);
|
]);
|
||||||
const [servername] = useServerApiState((state) => [state.server.instance]);
|
const [servername] = useServerApiState((state) => [state.server.instance]);
|
||||||
const [instanceName, setInstanceName] = useState<string>();
|
const [instanceName, setInstanceName] = useState<string>();
|
||||||
|
const [preferredColorScheme] = useColorScheme();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hostKey && hostList[hostKey]) {
|
if (hostKey && hostList[hostKey]) {
|
||||||
@@ -68,13 +70,13 @@ export function NavHoverMenu({
|
|||||||
{instanceName ? (
|
{instanceName ? (
|
||||||
instanceName
|
instanceName
|
||||||
) : (
|
) : (
|
||||||
<Skeleton height={20} width={40} radius={theme.defaultRadius} />
|
<Skeleton height={20} width={40} radius={vars.radiusDefault} />
|
||||||
)}{' '}
|
)}{' '}
|
||||||
|{' '}
|
|{' '}
|
||||||
{servername ? (
|
{servername ? (
|
||||||
servername
|
servername
|
||||||
) : (
|
) : (
|
||||||
<Skeleton height={20} width={40} radius={theme.defaultRadius} />
|
<Skeleton height={20} width={40} radius={vars.radiusDefault} />
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
<Anchor href="#" fz="xs" onClick={openDrawer}>
|
<Anchor href="#" fz="xs" onClick={openDrawer}>
|
||||||
@@ -85,7 +87,11 @@ export function NavHoverMenu({
|
|||||||
<Divider
|
<Divider
|
||||||
my="sm"
|
my="sm"
|
||||||
mx="-md"
|
mx="-md"
|
||||||
color={theme.colorScheme === 'dark' ? 'dark.5' : 'gray.1'}
|
color={
|
||||||
|
preferredColorScheme === 'dark'
|
||||||
|
? vars.colors.dark[5]
|
||||||
|
: vars.colors.gray[1]
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<MenuLinks links={onlyItems} highlighted={true} />
|
<MenuLinks links={onlyItems} highlighted={true} />
|
||||||
<div className={classes.headerDropdownFooter}>
|
<div className={classes.headerDropdownFooter}>
|
||||||
|
@@ -1,17 +1,22 @@
|
|||||||
import { Trans } from '@lingui/macro';
|
import { Trans } from '@lingui/macro';
|
||||||
import { Button, Stack, Title } from '@mantine/core';
|
import { Button, Stack, Title } from '@mantine/core';
|
||||||
|
import { useColorScheme } from '@mantine/hooks';
|
||||||
import { IconExternalLink } from '@tabler/icons-react';
|
import { IconExternalLink } from '@tabler/icons-react';
|
||||||
|
import { useCodeMirror } from '@uiw/react-codemirror';
|
||||||
|
|
||||||
|
import { vars } from '../../theme';
|
||||||
|
|
||||||
export default function FeedbackWidget() {
|
export default function FeedbackWidget() {
|
||||||
|
const [preferredColorScheme] = useColorScheme();
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
sx={(theme) => ({
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
theme.colorScheme === 'dark'
|
preferredColorScheme === 'dark'
|
||||||
? theme.colors.gray[9]
|
? vars.colors.gray[9]
|
||||||
: theme.colors.gray[1],
|
: vars.colors.gray[1],
|
||||||
borderRadius: theme.radius.md
|
borderRadius: vars.radius.md
|
||||||
})}
|
}}
|
||||||
p={15}
|
p={15}
|
||||||
>
|
>
|
||||||
<Title order={5}>
|
<Title order={5}>
|
||||||
|
@@ -31,7 +31,7 @@ export const layoutHeaderUser = style({
|
|||||||
//theme.colorScheme === 'dark' ? vars.colors.dark[0] : vars.black,
|
//theme.colorScheme === 'dark' ? vars.colors.dark[0] : vars.black,
|
||||||
vars.colors.black,
|
vars.colors.black,
|
||||||
padding: `${vars.spacing.xs}px ${vars.spacing.sm}px`,
|
padding: `${vars.spacing.xs}px ${vars.spacing.sm}px`,
|
||||||
borderRadius: vars.defaultRadius,
|
borderRadius: vars.radiusDefault,
|
||||||
transition: 'background-color 100ms ease',
|
transition: 'background-color 100ms ease',
|
||||||
|
|
||||||
[vars.smallerThan('xs')]: {
|
[vars.smallerThan('xs')]: {
|
||||||
@@ -84,7 +84,7 @@ export const link = style({
|
|||||||
export const subLink = style({
|
export const subLink = style({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
padding: `${vars.spacing.xs} ${vars.spacing.md}`,
|
padding: `${vars.spacing.xs} ${vars.spacing.md}`,
|
||||||
borderRadius: vars.defaultRadius,
|
borderRadius: vars.radiusDefault,
|
||||||
|
|
||||||
// ...theme.fn.hover({
|
// ...theme.fn.hover({
|
||||||
// backgroundColor:
|
// backgroundColor:
|
||||||
|
@@ -36,6 +36,7 @@ export default function Login() {
|
|||||||
|
|
||||||
// Data manipulation functions
|
// Data manipulation functions
|
||||||
function ChangeHost(newHost: string | null): void {
|
function ChangeHost(newHost: string | null): void {
|
||||||
|
if (newHost === null) return;
|
||||||
setHost(hostList[newHost]?.host, newHost);
|
setHost(hostList[newHost]?.host, newHost);
|
||||||
setApiDefaults();
|
setApiDefaults();
|
||||||
fetchServerApiState();
|
fetchServerApiState();
|
||||||
|
@@ -301,7 +301,7 @@ export default function Scan() {
|
|||||||
data={inputOptions}
|
data={inputOptions}
|
||||||
searchable
|
searchable
|
||||||
placeholder={t`Select input method`}
|
placeholder={t`Select input method`}
|
||||||
nothingFound={t`Nothing found`}
|
nothingFoundMessage={t`Nothing found`}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
{inp}
|
{inp}
|
||||||
|
@@ -134,9 +134,9 @@ export default function StockItemTestResultTable({
|
|||||||
return (
|
return (
|
||||||
<Group justify="apart">
|
<Group justify="apart">
|
||||||
<Text
|
<Text
|
||||||
italic={installed}
|
style={{ fontStyle: installed ? 'italic' : undefined }}
|
||||||
fw={required && 700}
|
fw={required && 700}
|
||||||
color={enabled ? undefined : 'red'}
|
c={enabled ? undefined : 'red'}
|
||||||
>
|
>
|
||||||
{!record.templateId && '- '}
|
{!record.templateId && '- '}
|
||||||
{record.test_name ?? record.template_detail?.test_name}
|
{record.test_name ?? record.template_detail?.test_name}
|
||||||
|
Reference in New Issue
Block a user