mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-03 15:52:51 +00:00
feat(forntend): Re-Add About link to main nav dropdown (#10395)
* Re-Add About link to main nav dropdown Closes #10392 * disable text selection on most of version dialog - maybe that helps ppl. copying the right section * highlight the correct copy button
This commit is contained in:
@@ -2,6 +2,7 @@ import { t } from '@lingui/core/macro';
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Button,
|
Button,
|
||||||
|
type DefaultMantineColor,
|
||||||
CopyButton as MantineCopyButton,
|
CopyButton as MantineCopyButton,
|
||||||
type MantineSize,
|
type MantineSize,
|
||||||
Text,
|
Text,
|
||||||
@@ -16,12 +17,14 @@ export function CopyButton({
|
|||||||
value,
|
value,
|
||||||
label,
|
label,
|
||||||
content,
|
content,
|
||||||
size
|
size,
|
||||||
|
color = 'gray'
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
value: any;
|
value: any;
|
||||||
label?: string;
|
label?: string;
|
||||||
content?: JSX.Element;
|
content?: JSX.Element;
|
||||||
size?: MantineSize;
|
size?: MantineSize;
|
||||||
|
color?: DefaultMantineColor;
|
||||||
}>) {
|
}>) {
|
||||||
const ButtonComponent = label ? Button : ActionIcon;
|
const ButtonComponent = label ? Button : ActionIcon;
|
||||||
|
|
||||||
@@ -30,7 +33,7 @@ export function CopyButton({
|
|||||||
{({ copied, copy }) => (
|
{({ copied, copy }) => (
|
||||||
<Tooltip label={copied ? t`Copied` : t`Copy`} withArrow>
|
<Tooltip label={copied ? t`Copied` : t`Copy`} withArrow>
|
||||||
<ButtonComponent
|
<ButtonComponent
|
||||||
color={copied ? 'teal' : 'gray'}
|
color={copied ? 'teal' : color}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
variant='transparent'
|
variant='transparent'
|
||||||
size={size ?? 'sm'}
|
size={size ?? 'sm'}
|
||||||
|
@@ -156,7 +156,7 @@ const AboutContent = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack style={{ userSelect: 'none' }}>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Group justify='space-between' wrap='nowrap'>
|
<Group justify='space-between' wrap='nowrap'>
|
||||||
<StylishText size='lg'>
|
<StylishText size='lg'>
|
||||||
@@ -187,7 +187,13 @@ const AboutContent = ({
|
|||||||
</Table>
|
</Table>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Group justify='space-between'>
|
<Group justify='space-between'>
|
||||||
<CopyButton value={copyval} label={t`Copy version information`} />
|
<div style={{ border: '1px solid orange', borderRadius: '8px' }}>
|
||||||
|
<CopyButton
|
||||||
|
value={copyval}
|
||||||
|
label={t`Copy version information`}
|
||||||
|
color='orange'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<Space />
|
<Space />
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@@ -9,6 +9,7 @@ import {
|
|||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
IconChevronDown,
|
IconChevronDown,
|
||||||
|
IconInfoCircle,
|
||||||
IconLogout,
|
IconLogout,
|
||||||
IconMoonStars,
|
IconMoonStars,
|
||||||
IconSettings,
|
IconSettings,
|
||||||
@@ -18,6 +19,7 @@ import {
|
|||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
import { useShallow } from 'zustand/react/shallow';
|
import { useShallow } from 'zustand/react/shallow';
|
||||||
|
import { aboutInvenTree } from '../../defaults/links';
|
||||||
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';
|
||||||
@@ -90,6 +92,12 @@ export function MainMenu() {
|
|||||||
>
|
>
|
||||||
<Trans>Change Color Mode</Trans>
|
<Trans>Change Color Mode</Trans>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
<Menu.Item
|
||||||
|
onClick={() => aboutInvenTree()}
|
||||||
|
leftSection={<IconInfoCircle />}
|
||||||
|
>
|
||||||
|
<Trans>About InvenTree</Trans>
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
leftSection={<IconLogout />}
|
leftSection={<IconLogout />}
|
||||||
|
Reference in New Issue
Block a user