-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(visualizator-fe): Add option to upload custom skybox ✨
- Loading branch information
1 parent
27e8e60
commit ce80e4b
Showing
21 changed files
with
545 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
apps/visualizator-fe/src/components/Options/GeneralOptions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { ColorInput, Select, Stack } from '@mantine/core'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useSelectedParachain } from '../../context/SelectedParachain/useSelectedParachain'; | ||
import { CountOption } from '../../gql/graphql'; | ||
|
||
const Options = () => { | ||
const { t } = useTranslation(); | ||
const { | ||
primaryChannelColor, | ||
setPrimaryChannelColor, | ||
highlightedChannelColor, | ||
setHighlightedChannelColor, | ||
secondaryChannelColor, | ||
setSecondaryChannelColor, | ||
selectedChannelColor, | ||
setSelectedChannelColor, | ||
parachainArrangement, | ||
setParachainArrangement | ||
} = useSelectedParachain(); | ||
|
||
const onParachainArrangementChange = (value: string | null) => { | ||
setParachainArrangement(value as CountOption); | ||
}; | ||
|
||
return ( | ||
<Stack gap="sm" pr="lg"> | ||
<ColorInput | ||
label={t('primaryChannelColor')} | ||
placeholder={t('selectColor')} | ||
value={primaryChannelColor} | ||
onChange={setPrimaryChannelColor} | ||
/> | ||
<ColorInput | ||
label={t('highlightedChannelColor')} | ||
placeholder={t('selectColor')} | ||
value={highlightedChannelColor} | ||
onChange={setHighlightedChannelColor} | ||
/> | ||
<ColorInput | ||
label={t('secondaryChannelColor')} | ||
placeholder={t('selectColor')} | ||
value={secondaryChannelColor} | ||
onChange={setSecondaryChannelColor} | ||
/> | ||
<ColorInput | ||
label={t('selectedChannelColor')} | ||
placeholder={t('selectColor')} | ||
value={selectedChannelColor} | ||
onChange={setSelectedChannelColor} | ||
/> | ||
<Select | ||
label={t('arrangement')} | ||
placeholder={t('selectArrangement')} | ||
data={[ | ||
{ value: CountOption.ORIGIN, label: t('byOrigin') }, | ||
{ value: CountOption.DESTINATION, label: t('byDestination') }, | ||
{ value: CountOption.BOTH, label: t('byBoth') } | ||
]} | ||
value={parachainArrangement} | ||
onChange={onParachainArrangementChange} | ||
/> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default Options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Grid, Text, Title } from '@mantine/core'; | ||
import GeneralOptions from './GeneralOptions'; | ||
import SkyboxUploadForm from './SkyboxUploadForm'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const Options = () => { | ||
const { t } = useTranslation('translation', { | ||
keyPrefix: 'options' | ||
}); | ||
return ( | ||
<Grid gutter="xl"> | ||
<Grid.Col | ||
span={{ | ||
base: 12, | ||
md: 6 | ||
}} | ||
> | ||
<Title order={5} mb="xs" pr="lg"> | ||
{t('generalTitle')} | ||
</Title> | ||
<Text size="sm" mb="md" c="dimmed" pr="lg"> | ||
{t('generalOptionsDesc')} | ||
</Text> | ||
<GeneralOptions /> | ||
</Grid.Col> | ||
<Grid.Col | ||
span={{ | ||
base: 12, | ||
md: 6 | ||
}} | ||
> | ||
<Title order={5} mb="xs"> | ||
{t('customSkyboxTitle')} | ||
</Title> | ||
<Text size="sm" mb="md" c="dimmed"> | ||
{t('customSkyboxDesc')} | ||
</Text> | ||
<SkyboxUploadForm /> | ||
</Grid.Col> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default Options; |
29 changes: 29 additions & 0 deletions
29
apps/visualizator-fe/src/components/Options/OptionsModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { FC } from 'react'; | ||
import { Modal, Title } from '@mantine/core'; | ||
import Options from './Options'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
type Props = { | ||
opened: boolean; | ||
close: () => void; | ||
}; | ||
|
||
const OptionsModal: FC<Props> = ({ opened, close }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Modal.Root opened={opened} onClose={close} size="xl"> | ||
<Modal.Overlay backgroundOpacity={0.55} blur={3} /> | ||
<Modal.Content> | ||
<Modal.Header pb="xs"> | ||
<Title order={4}>{t('editOptions')}</Title> | ||
<Modal.CloseButton /> | ||
</Modal.Header> | ||
<Modal.Body p="lg"> | ||
<Options /> | ||
</Modal.Body> | ||
</Modal.Content> | ||
</Modal.Root> | ||
); | ||
}; | ||
|
||
export default OptionsModal; |
Oops, something went wrong.