2
0
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:
Matthias Mair
2025-09-26 02:51:24 +02:00
committed by GitHub
parent 4794d69687
commit eb18c0b172
3 changed files with 21 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import { t } from '@lingui/core/macro';
import {
ActionIcon,
Button,
type DefaultMantineColor,
CopyButton as MantineCopyButton,
type MantineSize,
Text,
@@ -16,12 +17,14 @@ export function CopyButton({
value,
label,
content,
size
size,
color = 'gray'
}: Readonly<{
value: any;
label?: string;
content?: JSX.Element;
size?: MantineSize;
color?: DefaultMantineColor;
}>) {
const ButtonComponent = label ? Button : ActionIcon;
@@ -30,7 +33,7 @@ export function CopyButton({
{({ copied, copy }) => (
<Tooltip label={copied ? t`Copied` : t`Copy`} withArrow>
<ButtonComponent
color={copied ? 'teal' : 'gray'}
color={copied ? 'teal' : color}
onClick={copy}
variant='transparent'
size={size ?? 'sm'}

View File

@@ -156,7 +156,7 @@ const AboutContent = ({
}
return (
<Stack>
<Stack style={{ userSelect: 'none' }}>
<Divider />
<Group justify='space-between' wrap='nowrap'>
<StylishText size='lg'>
@@ -187,7 +187,13 @@ const AboutContent = ({
</Table>
<Divider />
<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 />
<Button
onClick={() => {

View File

@@ -9,6 +9,7 @@ import {
} from '@mantine/core';
import {
IconChevronDown,
IconInfoCircle,
IconLogout,
IconMoonStars,
IconSettings,
@@ -18,6 +19,7 @@ import {
} from '@tabler/icons-react';
import { Link, useNavigate } from 'react-router-dom';
import { useShallow } from 'zustand/react/shallow';
import { aboutInvenTree } from '../../defaults/links';
import { doLogout } from '../../functions/auth';
import * as classes from '../../main.css';
import { useUserState } from '../../states/UserState';
@@ -90,6 +92,12 @@ export function MainMenu() {
>
<Trans>Change Color Mode</Trans>
</Menu.Item>
<Menu.Item
onClick={() => aboutInvenTree()}
leftSection={<IconInfoCircle />}
>
<Trans>About InvenTree</Trans>
</Menu.Item>
<Menu.Divider />
<Menu.Item
leftSection={<IconLogout />}