Search/help updates
This commit is contained in:
@@ -1,14 +1,15 @@
|
|||||||
import { Divider, Group, Modal, Stack, Text } from '@mantine/core';
|
import { Divider, Group, Modal, Stack } from '@mantine/core';
|
||||||
import { useCommonHooks } from 'hooks';
|
import { useCommonHooks } from 'hooks';
|
||||||
import { modalClasses } from 'styles';
|
import { modalClasses } from 'styles';
|
||||||
|
import HintItem from './HintItem';
|
||||||
|
|
||||||
export function HelpModal({
|
export function HelpModal({
|
||||||
providerModalOpened,
|
providerModalOpened,
|
||||||
closeProviderModal,
|
closeProviderModal,
|
||||||
|
applicationData,
|
||||||
providerData,
|
providerData,
|
||||||
}: any) {
|
}: any) {
|
||||||
const { theme, setSearchValue, setProviderLabel, setProviderURL } = useCommonHooks();
|
const { theme, setSearchValue, setProviderLabel, setProviderURL } = useCommonHooks();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal.Root
|
<Modal.Root
|
||||||
size={'60%'}
|
size={'60%'}
|
||||||
@@ -40,14 +41,67 @@ export function HelpModal({
|
|||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body pb={'2rem'}>
|
<Modal.Body pb={'2rem'}>
|
||||||
<Stack gap={0} w={'100%'} align='center'>
|
<Stack gap={0} w={'100%'} align='center'>
|
||||||
<h3 style={{ padding: 0, margin: 0 }}>Search Providers</h3>
|
<h3
|
||||||
<Divider py={8} w={'65%'} color={theme.accentColor} />
|
style={{
|
||||||
{providerData?.map((provider: any) => (
|
zIndex: 0,
|
||||||
<Group key={provider.prefix} gap={0} w={'50%'} justify='space-between'>
|
padding: '8px',
|
||||||
<Text>{provider.prefix}</Text>
|
marginTop: 0,
|
||||||
<Text>{provider.name}</Text>
|
marginBottom: -32,
|
||||||
</Group>
|
borderRadius: '8px',
|
||||||
))}
|
color: theme.backgroundColor,
|
||||||
|
backgroundColor: theme.borderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Search Providers
|
||||||
|
</h3>
|
||||||
|
<Divider py={8} color={theme.accentColor} />
|
||||||
|
<Group
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: theme.searchColor,
|
||||||
|
borderRadius: '8px',
|
||||||
|
padding: '24px',
|
||||||
|
justifyItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{providerData?.map((provider: any) => (
|
||||||
|
<HintItem
|
||||||
|
key={provider.prefix}
|
||||||
|
command={provider.prefix}
|
||||||
|
item={provider.name}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Group>
|
||||||
|
<h3
|
||||||
|
style={{
|
||||||
|
zIndex: 0,
|
||||||
|
padding: '8px',
|
||||||
|
marginBottom: -32,
|
||||||
|
borderRadius: '8px',
|
||||||
|
color: theme.backgroundColor,
|
||||||
|
backgroundColor: theme.borderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Available Applications
|
||||||
|
</h3>
|
||||||
|
<Divider py={8} color={theme.accentColor} />
|
||||||
|
<Group
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: theme.searchColor,
|
||||||
|
borderRadius: '8px',
|
||||||
|
padding: '32px',
|
||||||
|
justifyItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{applicationData?.map((application: any) => (
|
||||||
|
<HintItem
|
||||||
|
key={application.id}
|
||||||
|
command={`!${application.baseUrl.substr(1).toLowerCase()}`}
|
||||||
|
item={application.url}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
|
|||||||
40
src/components/HelpModal/HintItem.tsx
Normal file
40
src/components/HelpModal/HintItem.tsx
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import { Group, Text } from '@mantine/core';
|
||||||
|
|
||||||
|
function HintItem({ command, item }: any) {
|
||||||
|
return (
|
||||||
|
<Group
|
||||||
|
gap={0}
|
||||||
|
align='center'
|
||||||
|
justify='center'
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
padding: '8px',
|
||||||
|
borderRadius: '10px',
|
||||||
|
backgroundColor: 'var(--color-background)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: 'var(--color-background)',
|
||||||
|
backgroundColor: 'var(--color-text-pri)',
|
||||||
|
padding: '8px',
|
||||||
|
borderRadius: '10px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{command}
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: 'var(--color-background)',
|
||||||
|
backgroundColor: 'var(--color-text-acc)',
|
||||||
|
padding: '8px',
|
||||||
|
borderRadius: '10px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item}
|
||||||
|
</Text>
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HintItem;
|
||||||
@@ -73,7 +73,7 @@ function LargeHeader({ greet, date, setCurrent, weather, basicWeather }: any) {
|
|||||||
.replace('$^lastName', currentUser.lastName.toUpperCase())}
|
.replace('$^lastName', currentUser.lastName.toUpperCase())}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
fz={48}
|
fz={36}
|
||||||
className={textClasses.dateTime}
|
className={textClasses.dateTime}
|
||||||
classNames={textClasses}
|
classNames={textClasses}
|
||||||
m={0}
|
m={0}
|
||||||
|
|||||||
Reference in New Issue
Block a user