-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
330 additions
and
28 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
36 changes: 36 additions & 0 deletions
36
packages/widget/src/components/SettingsDrawer/EnabledBridgesSelect.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,36 @@ | ||
import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material'; | ||
import { Box, FormControl, MenuItem, Typography } from '@mui/material'; | ||
import { useFormContext } from 'react-hook-form'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { SwapFormKey } from '../../providers/SwapFormProvider'; | ||
import { Select } from '../Select'; | ||
|
||
export const EnabledBridgesSelect: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const { register } = useFormContext(); | ||
|
||
return ( | ||
<Box mt={3}> | ||
<Box sx={{ display: 'flex', alignItems: 'center' }} mb={1}> | ||
<HelpOutlineIcon sx={{ color: 'grey.500' }} /> | ||
<Typography | ||
variant="subtitle1" | ||
color="text.secondary" | ||
lineHeight="normal" | ||
ml={1} | ||
> | ||
{t(`settings.enabledBridges`)} | ||
</Typography> | ||
</Box> | ||
<FormControl fullWidth> | ||
<Select | ||
defaultValue={1} | ||
MenuProps={{ elevation: 2 }} | ||
inputProps={{ ...register(SwapFormKey.EnabledBridges) }} | ||
> | ||
<MenuItem value={1}>{t(`swap.routePriority.recommended`)}</MenuItem> | ||
</Select> | ||
</FormControl> | ||
</Box> | ||
); | ||
}; |
36 changes: 36 additions & 0 deletions
36
packages/widget/src/components/SettingsDrawer/EnabledExchangesSelect.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,36 @@ | ||
import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material'; | ||
import { Box, FormControl, MenuItem, Typography } from '@mui/material'; | ||
import { useFormContext } from 'react-hook-form'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { SwapFormKey } from '../../providers/SwapFormProvider'; | ||
import { Select } from '../Select'; | ||
|
||
export const EnabledExchangesSelect: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const { register } = useFormContext(); | ||
|
||
return ( | ||
<Box mt={3}> | ||
<Box sx={{ display: 'flex', alignItems: 'center' }} mb={1}> | ||
<HelpOutlineIcon sx={{ color: 'grey.500' }} /> | ||
<Typography | ||
variant="subtitle1" | ||
color="text.secondary" | ||
lineHeight="normal" | ||
ml={1} | ||
> | ||
{t(`settings.enabledExchanges`)} | ||
</Typography> | ||
</Box> | ||
<FormControl fullWidth> | ||
<Select | ||
defaultValue={1} | ||
MenuProps={{ elevation: 2 }} | ||
inputProps={{ ...register(SwapFormKey.EnabledExchanges) }} | ||
> | ||
<MenuItem value={1}>{t(`swap.routePriority.recommended`)}</MenuItem> | ||
</Select> | ||
</FormControl> | ||
</Box> | ||
); | ||
}; |
38 changes: 38 additions & 0 deletions
38
packages/widget/src/components/SettingsDrawer/SettingsDrawer.style.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,38 @@ | ||
import { | ||
Button as MuiButton, | ||
ButtonGroup as MuiButtonGroup, | ||
} from '@mui/material'; | ||
import { buttonClasses } from '@mui/material/Button'; | ||
import { buttonGroupClasses } from '@mui/material/ButtonGroup'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
export const Button = styled(MuiButton)(({ theme }) => ({ | ||
textTransform: 'none', | ||
borderRadius: 8, | ||
padding: '7px 21px', | ||
border: `2px solid rgba(19, 60, 76, 0.12)`, | ||
[`&.${buttonClasses.outlined}`]: { | ||
color: theme.palette.text.secondary, | ||
fontWeight: 400, | ||
}, | ||
[`&:hover`]: { | ||
border: 2, | ||
borderStyle: 'solid', | ||
borderColor: theme.palette.primary.main, | ||
}, | ||
[`&.${buttonClasses.outlined}:hover`]: { | ||
color: theme.palette.primary.main, | ||
backgroundColor: 'rgb(0 0 0 / 2%)', | ||
borderColor: 'currentColor', | ||
}, | ||
})); | ||
|
||
export const ButtonGroup = styled(MuiButtonGroup)(({ theme }) => ({ | ||
[`& .${buttonGroupClasses.grouped}:not(.${buttonClasses.contained}:last-of-type):hover`]: | ||
{ | ||
borderRightColor: theme.palette.primary.main, | ||
}, | ||
[`& .${buttonGroupClasses.grouped}:not(:first-of-type)`]: { | ||
marginLeft: '-2px', | ||
}, | ||
})); |
178 changes: 175 additions & 3 deletions
178
packages/widget/src/components/SettingsDrawer/SettingsDrawer.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
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
Oops, something went wrong.