Updates to help modal
All checks were successful
Deploy to production / build (push) Successful in 1m7s
All checks were successful
Deploy to production / build (push) Successful in 1m7s
This commit is contained in:
44
package-lock.json
generated
44
package-lock.json
generated
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "triggerfrontend",
|
"name": "triggerfrontend",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "triggerfrontend",
|
"name": "triggerfrontend",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gfazioli/mantine-text-animate": "^2.3.13",
|
"@gfazioli/mantine-text-animate": "^2.4.0",
|
||||||
"@hello-pangea/dnd": "^18.0.1",
|
"@hello-pangea/dnd": "^18.0.1",
|
||||||
"@mantine/core": "^8.3.14",
|
"@mantine/core": "^8.3.14",
|
||||||
"@mantine/dates": "^8.3.14",
|
"@mantine/dates": "^8.3.14",
|
||||||
@@ -29,16 +29,16 @@
|
|||||||
"recharts": "^3.7.0"
|
"recharts": "^3.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.2.1",
|
"@types/node": "^25.2.3",
|
||||||
"@types/react": "^19.2.13",
|
"@types/react": "^19.2.13",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^5.1.3",
|
"@vitejs/plugin-react": "^5.1.4",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"@vitest/ui": "^4.0.18",
|
"@vitest/ui": "^4.0.18",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^7.3.1",
|
"vite": "^7.3.1",
|
||||||
"vite-plugin-dts": "~4.5.4",
|
"vite-plugin-dts": "~4.5.4",
|
||||||
"vite-tsconfig-paths": "^6.0.5",
|
"vite-tsconfig-paths": "^6.1.0",
|
||||||
"vitest": "^4.0.18"
|
"vitest": "^4.0.18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -820,9 +820,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@gfazioli/mantine-text-animate": {
|
"node_modules/@gfazioli/mantine-text-animate": {
|
||||||
"version": "2.3.13",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@gfazioli/mantine-text-animate/-/mantine-text-animate-2.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/@gfazioli/mantine-text-animate/-/mantine-text-animate-2.4.0.tgz",
|
||||||
"integrity": "sha512-EUx9aYfRiy021sYNjbVt3D+fl1S3S74g7h68yOsm2XEhcbMrjiyahoJkoxsySGIQRRnUbnIkG+ncvi68v9eApg==",
|
"integrity": "sha512-m6zZf6MB8Xm40fEGjSAmcs4gYx0ovWzgIQKhTlsaPDF0w1oD4n1Lj1SX4+vdefSGrGef7Xaazt7mrW2HE2ACdA==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@mantine/core": ">=7.0.0",
|
"@mantine/core": ">=7.0.0",
|
||||||
"@mantine/hooks": ">=7.0.0",
|
"@mantine/hooks": ">=7.0.0",
|
||||||
@@ -1152,9 +1152,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rolldown/pluginutils": {
|
"node_modules/@rolldown/pluginutils": {
|
||||||
"version": "1.0.0-rc.2",
|
"version": "1.0.0-rc.3",
|
||||||
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz",
|
||||||
"integrity": "sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==",
|
"integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/pluginutils": {
|
"node_modules/@rollup/pluginutils": {
|
||||||
@@ -1837,9 +1837,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "25.2.1",
|
"version": "25.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.3.tgz",
|
||||||
"integrity": "sha512-CPrnr8voK8vC6eEtyRzvMpgp3VyVRhgclonE7qYi6P9sXwYb59ucfrnmFBTaP0yUi8Gk4yZg/LlTJULGxvTNsg==",
|
"integrity": "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~7.16.0"
|
"undici-types": "~7.16.0"
|
||||||
@@ -1871,15 +1871,15 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@vitejs/plugin-react": {
|
"node_modules/@vitejs/plugin-react": {
|
||||||
"version": "5.1.3",
|
"version": "5.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz",
|
||||||
"integrity": "sha512-NVUnA6gQCl8jfoYqKqQU5Clv0aPw14KkZYCsX6T9Lfu9slI0LOU10OTwFHS/WmptsMMpshNd/1tuWsHQ2Uk+cg==",
|
"integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.29.0",
|
"@babel/core": "^7.29.0",
|
||||||
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
|
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
|
||||||
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
|
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
|
||||||
"@rolldown/pluginutils": "1.0.0-rc.2",
|
"@rolldown/pluginutils": "1.0.0-rc.3",
|
||||||
"@types/babel__core": "^7.20.5",
|
"@types/babel__core": "^7.20.5",
|
||||||
"react-refresh": "^0.18.0"
|
"react-refresh": "^0.18.0"
|
||||||
},
|
},
|
||||||
@@ -4189,9 +4189,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite-tsconfig-paths": {
|
"node_modules/vite-tsconfig-paths": {
|
||||||
"version": "6.0.5",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-6.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-6.1.0.tgz",
|
||||||
"integrity": "sha512-f/WvY6ekHykUF1rWJUAbCU7iS/5QYDIugwpqJA+ttwKbxSbzNlqlE8vZSrsnxNQciUW+z6lvhlXMaEyZn9MSig==",
|
"integrity": "sha512-kpd3sY9glHIDaq4V/Tlc1Y8WaKtutoc3B525GHxEVKWX42FKfQsXvjFOemu1I8VIN8pNbrMLWVTbW79JaRUxKg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gfazioli/mantine-text-animate": "^2.3.13",
|
"@gfazioli/mantine-text-animate": "^2.4.0",
|
||||||
"@hello-pangea/dnd": "^18.0.1",
|
"@hello-pangea/dnd": "^18.0.1",
|
||||||
"@mantine/core": "^8.3.14",
|
"@mantine/core": "^8.3.14",
|
||||||
"@mantine/dates": "^8.3.14",
|
"@mantine/dates": "^8.3.14",
|
||||||
@@ -31,16 +31,16 @@
|
|||||||
"recharts": "^3.7.0"
|
"recharts": "^3.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.2.1",
|
"@types/node": "^25.2.3",
|
||||||
"@types/react": "^19.2.13",
|
"@types/react": "^19.2.13",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^5.1.3",
|
"@vitejs/plugin-react": "^5.1.4",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"@vitest/ui": "^4.0.18",
|
"@vitest/ui": "^4.0.18",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^7.3.1",
|
"vite": "^7.3.1",
|
||||||
"vite-plugin-dts": "~4.5.4",
|
"vite-plugin-dts": "~4.5.4",
|
||||||
"vite-tsconfig-paths": "^6.0.5",
|
"vite-tsconfig-paths": "^6.1.0",
|
||||||
"vitest": "^4.0.18"
|
"vitest": "^4.0.18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,9 +43,24 @@ export function HelpModal({
|
|||||||
<Modal.CloseButton />
|
<Modal.CloseButton />
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body pb={'2rem'}>
|
<Modal.Body pb={'2rem'}>
|
||||||
|
<Stack
|
||||||
|
gap={0}
|
||||||
|
w={'100%'}
|
||||||
|
align='center'
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: 'var(--mantine-color-search-0)',
|
||||||
|
borderRadius: '8px',
|
||||||
|
padding: '1rem',
|
||||||
|
marginBottom: '1rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Expand each of the sections below to find available Search Bar commands.
|
||||||
|
</Stack>
|
||||||
<Stack gap={0} w={'100%'} align='center'>
|
<Stack gap={0} w={'100%'} align='center'>
|
||||||
<HelpSection
|
<HelpSection
|
||||||
name={'Search Providers'}
|
name={'Search Providers'}
|
||||||
|
prefix={'/'}
|
||||||
items={providerData.map((provider: Provider) => {
|
items={providerData.map((provider: Provider) => {
|
||||||
return {
|
return {
|
||||||
name: provider.name,
|
name: provider.name,
|
||||||
@@ -56,6 +71,7 @@ export function HelpModal({
|
|||||||
<Stack my={'.5rem'} />
|
<Stack my={'.5rem'} />
|
||||||
<HelpSection
|
<HelpSection
|
||||||
name={'Available Applications'}
|
name={'Available Applications'}
|
||||||
|
prefix={'!'}
|
||||||
items={applicationData.map((application: Application) => {
|
items={applicationData.map((application: Application) => {
|
||||||
return {
|
return {
|
||||||
name: application.url,
|
name: application.url,
|
||||||
@@ -66,6 +82,7 @@ export function HelpModal({
|
|||||||
<Stack my={'.5rem'} />
|
<Stack my={'.5rem'} />
|
||||||
<HelpSection
|
<HelpSection
|
||||||
name={'Available Clients'}
|
name={'Available Clients'}
|
||||||
|
prefix={'>'}
|
||||||
items={clientData.map((client: GuacamoleClient) => {
|
items={clientData.map((client: GuacamoleClient) => {
|
||||||
return {
|
return {
|
||||||
name: `${client.clientName} (${client.clientIdentifier})`,
|
name: `${client.clientName} (${client.clientIdentifier})`,
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
import { Group, Text } from '@mantine/core';
|
import { ActionIcon, Group, Text } from '@mantine/core';
|
||||||
import { useCommonHooks } from 'hooks';
|
import { useCommonHooks } from 'hooks';
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { FiChevronDown, FiChevronUp } from 'react-icons/fi';
|
||||||
import { textClasses } from 'styles';
|
import { textClasses } from 'styles';
|
||||||
import type { SearchShortcut } from 'types';
|
import type { SearchShortcut } from 'types';
|
||||||
import HintItem from './HintItem';
|
import HintItem from './HintItem';
|
||||||
|
|
||||||
function HelpSection({ name, items }: { name: string; items: SearchShortcut[] }) {
|
function HelpSection({
|
||||||
|
name,
|
||||||
|
prefix,
|
||||||
|
items,
|
||||||
|
}: {
|
||||||
|
name: string;
|
||||||
|
prefix: string;
|
||||||
|
items: SearchShortcut[];
|
||||||
|
}) {
|
||||||
const { theme } = useCommonHooks();
|
const { theme } = useCommonHooks();
|
||||||
|
const [expand, setExpand] = useState(false);
|
||||||
return (
|
return (
|
||||||
<Group gap={4}>
|
<Group gap={4} style={{ width: '100%' }}>
|
||||||
<Text
|
<Text
|
||||||
className={textClasses.helpTitle}
|
className={textClasses.helpTitle}
|
||||||
classNames={textClasses}
|
classNames={textClasses}
|
||||||
@@ -17,23 +28,50 @@ function HelpSection({ name, items }: { name: string; items: SearchShortcut[] })
|
|||||||
: undefined,
|
: undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{name}
|
{name}{' '}
|
||||||
|
<ActionIcon onClick={() => setExpand(!expand)}>
|
||||||
|
{expand ? <FiChevronUp /> : <FiChevronDown />}
|
||||||
|
</ActionIcon>
|
||||||
</Text>
|
</Text>
|
||||||
<Group
|
<Group
|
||||||
style={{
|
style={{
|
||||||
|
height: expand ? '100%' : '0px',
|
||||||
|
overflow: expand ? 'visible' : 'hidden',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
backgroundColor: 'var(--mantine-color-search-0)',
|
backgroundColor: 'var(--mantine-color-search-0)',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
padding: '1.5rem',
|
padding: '1.5rem',
|
||||||
|
marginLeft: '1rem',
|
||||||
|
marginRight: '1rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{items
|
{expand ? (
|
||||||
|
items
|
||||||
?.toSorted((a: SearchShortcut, b: SearchShortcut) =>
|
?.toSorted((a: SearchShortcut, b: SearchShortcut) =>
|
||||||
a.command > b.command ? 1 : -1,
|
a.command > b.command ? 1 : -1,
|
||||||
)
|
)
|
||||||
.map((item: SearchShortcut) => (
|
.map((item: SearchShortcut) => (
|
||||||
<HintItem key={item.command} command={item.command} name={item.name} />
|
<HintItem key={item.command} command={item.command} name={item.name} />
|
||||||
))}
|
))
|
||||||
|
) : (
|
||||||
|
<Group
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
marginTop: '-1.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color:
|
||||||
|
'color-mix(in srgb, var(--mantine-color-primary-0), transparent 75%)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Command prefix: {prefix}
|
||||||
|
</Text>
|
||||||
|
</Group>
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ export function useCommonHooks() {
|
|||||||
key: 'providerIcon',
|
key: 'providerIcon',
|
||||||
defaultValue: 'FaGoogle',
|
defaultValue: 'FaGoogle',
|
||||||
});
|
});
|
||||||
|
const [timeFormat, setTimeFormat] = useLocalStorage<string>({
|
||||||
|
key: 'timeFormat',
|
||||||
|
defaultValue: '12h',
|
||||||
|
});
|
||||||
const [searchValue, setSearchValue] = useState<string | number>('');
|
const [searchValue, setSearchValue] = useState<string | number>('');
|
||||||
const [providerLabel, setProviderLabel] = useState(defaultProviderLabel);
|
const [providerLabel, setProviderLabel] = useState(defaultProviderLabel);
|
||||||
const [providerURL, setProviderURL] = useState(defaultProviderURL);
|
const [providerURL, setProviderURL] = useState(defaultProviderURL);
|
||||||
@@ -268,6 +272,8 @@ export function useCommonHooks() {
|
|||||||
setDefaultProviderPrefix,
|
setDefaultProviderPrefix,
|
||||||
defaultProviderIcon,
|
defaultProviderIcon,
|
||||||
setDefaultProviderIcon,
|
setDefaultProviderIcon,
|
||||||
|
timeFormat,
|
||||||
|
setTimeFormat,
|
||||||
currentUser,
|
currentUser,
|
||||||
setCurrentUser,
|
setCurrentUser,
|
||||||
currentLocation,
|
currentLocation,
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ export function Homepage() {
|
|||||||
windDirection: 0,
|
windDirection: 0,
|
||||||
pressure: 0,
|
pressure: 0,
|
||||||
});
|
});
|
||||||
|
const [providerModalOpened, { open: openProviderModal, close: closeProviderModal }] =
|
||||||
|
useDisclosure(false);
|
||||||
const extendedForecast = forecast?.properties?.periods.map(
|
const extendedForecast = forecast?.properties?.periods.map(
|
||||||
(item: ExtendedForecast) => ({
|
(item: ExtendedForecast) => ({
|
||||||
detailedForecast: item.detailedForecast,
|
detailedForecast: item.detailedForecast,
|
||||||
@@ -209,6 +211,9 @@ export function Homepage() {
|
|||||||
openWeatherModal={openWeatherModal}
|
openWeatherModal={openWeatherModal}
|
||||||
position='top'
|
position='top'
|
||||||
personal={personal}
|
personal={personal}
|
||||||
|
providerModalOpened={providerModalOpened}
|
||||||
|
openProviderModal={openProviderModal}
|
||||||
|
closeProviderModal={closeProviderModal}
|
||||||
/>
|
/>
|
||||||
<Header
|
<Header
|
||||||
greet={displayedGreeting}
|
greet={displayedGreeting}
|
||||||
@@ -235,10 +240,13 @@ export function Homepage() {
|
|||||||
openWeatherModal={openWeatherModal}
|
openWeatherModal={openWeatherModal}
|
||||||
position='center'
|
position='center'
|
||||||
personal={personal}
|
personal={personal}
|
||||||
|
providerModalOpened={providerModalOpened}
|
||||||
|
openProviderModal={openProviderModal}
|
||||||
|
closeProviderModal={closeProviderModal}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<SettingsButton />
|
<SettingsButton openProviderModal={openProviderModal} />
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ function Header({
|
|||||||
theme,
|
theme,
|
||||||
textShadowStyle,
|
textShadowStyle,
|
||||||
largeTextShadowStyle,
|
largeTextShadowStyle,
|
||||||
|
timeFormat,
|
||||||
|
setTimeFormat,
|
||||||
} = useCommonHooks();
|
} = useCommonHooks();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -119,14 +121,19 @@ function Header({
|
|||||||
style={{
|
style={{
|
||||||
textShadow: theme.textShadowsEnabled ? textShadowStyle : undefined,
|
textShadow: theme.textShadowsEnabled ? textShadowStyle : undefined,
|
||||||
}}
|
}}
|
||||||
|
onClick={() =>
|
||||||
|
timeFormat === '12h' ? setTimeFormat('24h') : setTimeFormat('12h')
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{`${
|
{timeFormat === '12h'
|
||||||
|
? `${
|
||||||
time.getHours() === 0
|
time.getHours() === 0
|
||||||
? 12
|
? 12
|
||||||
: time.getHours() > 12
|
: time.getHours() > 12
|
||||||
? time.getHours() - 12
|
? time.getHours() - 12
|
||||||
: time.getHours()
|
: time.getHours()
|
||||||
}:${fixDigits(time.getMinutes())} ${time.getHours() >= 12 ? 'PM' : 'AM'}`}
|
}:${fixDigits(time.getMinutes())} ${time.getHours() >= 12 ? 'PM' : 'AM'}`
|
||||||
|
: `${fixDigits(time.getHours())}:${fixDigits(time.getMinutes())}`}
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ function LargeHeader({ greet, date }: { greet: string | undefined; date: string
|
|||||||
theme,
|
theme,
|
||||||
textShadowStyle,
|
textShadowStyle,
|
||||||
largeTextShadowStyle,
|
largeTextShadowStyle,
|
||||||
|
timeFormat,
|
||||||
|
setTimeFormat,
|
||||||
} = useCommonHooks();
|
} = useCommonHooks();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -58,15 +60,21 @@ function LargeHeader({ greet, date }: { greet: string | undefined; date: string
|
|||||||
classNames={textClasses}
|
classNames={textClasses}
|
||||||
style={{
|
style={{
|
||||||
textShadow: theme.textShadowsEnabled ? textShadowStyle : undefined,
|
textShadow: theme.textShadowsEnabled ? textShadowStyle : undefined,
|
||||||
|
zIndex: 1,
|
||||||
}}
|
}}
|
||||||
|
onClick={() =>
|
||||||
|
timeFormat === '12h' ? setTimeFormat('24h') : setTimeFormat('12h')
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{`${
|
{timeFormat === '12h'
|
||||||
|
? `${
|
||||||
time.getHours() === 0
|
time.getHours() === 0
|
||||||
? 12
|
? 12
|
||||||
: time.getHours() > 12
|
: time.getHours() > 12
|
||||||
? time.getHours() - 12
|
? time.getHours() - 12
|
||||||
: time.getHours()
|
: time.getHours()
|
||||||
}:${fixDigits(time.getMinutes())} ${time.getHours() >= 12 ? 'PM' : 'AM'}`}
|
}:${fixDigits(time.getMinutes())} ${time.getHours() >= 12 ? 'PM' : 'AM'}`
|
||||||
|
: `${fixDigits(time.getHours())}:${fixDigits(time.getMinutes())}`}
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ export default function Search({
|
|||||||
openWeatherModal,
|
openWeatherModal,
|
||||||
position,
|
position,
|
||||||
personal,
|
personal,
|
||||||
|
providerModalOpened,
|
||||||
|
openProviderModal,
|
||||||
|
closeProviderModal,
|
||||||
}: {
|
}: {
|
||||||
current: CurrentWeather;
|
current: CurrentWeather;
|
||||||
extendedForecast: ExtendedForecast[];
|
extendedForecast: ExtendedForecast[];
|
||||||
@@ -46,6 +49,9 @@ export default function Search({
|
|||||||
openWeatherModal: () => void;
|
openWeatherModal: () => void;
|
||||||
position: string;
|
position: string;
|
||||||
personal: PersonalData;
|
personal: PersonalData;
|
||||||
|
providerModalOpened: boolean;
|
||||||
|
openProviderModal: () => void;
|
||||||
|
closeProviderModal: () => void;
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
isMobile,
|
isMobile,
|
||||||
@@ -138,8 +144,6 @@ export default function Search({
|
|||||||
const [historyMultiplier, setHistoryMultiplier] = useState(1);
|
const [historyMultiplier, setHistoryMultiplier] = useState(1);
|
||||||
|
|
||||||
const [dropdownOpened, { open: openDropdown, close: closeDropdown }] = useDisclosure();
|
const [dropdownOpened, { open: openDropdown, close: closeDropdown }] = useDisclosure();
|
||||||
const [providerModalOpened, { open: openProviderModal, close: closeProviderModal }] =
|
|
||||||
useDisclosure(false);
|
|
||||||
|
|
||||||
const handleResetSearch = () => {
|
const handleResetSearch = () => {
|
||||||
setSearchValue('');
|
setSearchValue('');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Box, Button, Group, Menu, Overlay, Stack } from '@mantine/core';
|
import { Box, Button, Group, Menu, Overlay, Stack } from '@mantine/core';
|
||||||
import { useCommonHooks, useMutationAPI, useQueryAPI } from 'hooks';
|
import { useCommonHooks, useMutationAPI, useQueryAPI } from 'hooks';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { FiMenu, FiSettings } from 'react-icons/fi';
|
import { FiHelpCircle, FiMenu, FiSettings } from 'react-icons/fi';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { buttonClasses, menuClasses } from 'styles';
|
import { buttonClasses, menuClasses } from 'styles';
|
||||||
import type { AppCategory, WolClient } from 'types';
|
import type { AppCategory, WolClient } from 'types';
|
||||||
@@ -9,7 +9,7 @@ import SettingsCard from './SettingsCard';
|
|||||||
import ThemingCard from './ThemingCard';
|
import ThemingCard from './ThemingCard';
|
||||||
import WakeOnLan from './WakeOnLanCard';
|
import WakeOnLan from './WakeOnLanCard';
|
||||||
|
|
||||||
function SettingsButton() {
|
function SettingsButton({ openProviderModal }: { openProviderModal: () => void }) {
|
||||||
const { data: appCategoryData } = useQueryAPI({
|
const { data: appCategoryData } = useQueryAPI({
|
||||||
endpoint: 'api/appCategories',
|
endpoint: 'api/appCategories',
|
||||||
});
|
});
|
||||||
@@ -32,7 +32,7 @@ function SettingsButton() {
|
|||||||
: [{ value: 'All', label: 'All' }];
|
: [{ value: 'All', label: 'All' }];
|
||||||
const [selectedClient, setSelectedClient] = useState<WolClient>(wolClientData?.[0]);
|
const [selectedClient, setSelectedClient] = useState<WolClient>(wolClientData?.[0]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const {
|
const {
|
||||||
theme,
|
theme,
|
||||||
isMobile,
|
isMobile,
|
||||||
@@ -72,10 +72,16 @@ function SettingsButton() {
|
|||||||
withOverlay
|
withOverlay
|
||||||
overlayProps={{
|
overlayProps={{
|
||||||
blur: 5,
|
blur: 5,
|
||||||
|
onClick: () => setIsOpen(false),
|
||||||
}}
|
}}
|
||||||
|
opened={isOpen}
|
||||||
>
|
>
|
||||||
<Menu.Target>
|
<Menu.Target>
|
||||||
<Button className={buttonClasses.settingsButton} classNames={buttonClasses}>
|
<Button
|
||||||
|
className={buttonClasses.settingsButton}
|
||||||
|
classNames={buttonClasses}
|
||||||
|
onClick={() => setIsOpen(true)}
|
||||||
|
>
|
||||||
<FiMenu />
|
<FiMenu />
|
||||||
</Button>
|
</Button>
|
||||||
</Menu.Target>
|
</Menu.Target>
|
||||||
@@ -149,6 +155,17 @@ function SettingsButton() {
|
|||||||
>
|
>
|
||||||
Settings
|
Settings
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
leftSection={<FiHelpCircle />}
|
||||||
|
className={buttonClasses.settingsMenuButton}
|
||||||
|
classNames={buttonClasses}
|
||||||
|
onClick={() => {
|
||||||
|
setIsOpen(false);
|
||||||
|
openProviderModal();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Help
|
||||||
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Menu.Dropdown>
|
</Menu.Dropdown>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
Reference in New Issue
Block a user