-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add OnlyV3Toggle component and enhance AMMV3 position managemen…
…t with new filtering options
- Loading branch information
Showing
7 changed files
with
125 additions
and
54 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
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
73 changes: 73 additions & 0 deletions
73
packages/dodoex-widgets/src/widgets/PoolWidget/PoolList/components/OnlyV3Toggle.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,73 @@ | ||
import { Box, ButtonBase, useTheme } from '@dodoex/components'; | ||
import { t } from '@lingui/macro'; | ||
|
||
export interface OnlyV3ToggleProps { | ||
onlyV3: boolean; | ||
setOnlyV3: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
export const OnlyV3Toggle = ({ onlyV3, setOnlyV3 }: OnlyV3ToggleProps) => { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<Box | ||
component={ButtonBase} | ||
onClick={() => setOnlyV3(!onlyV3)} | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
p: 2, | ||
borderRadius: 8, | ||
backgroundColor: theme.palette.border.main, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
px: 16, | ||
py: 4, | ||
borderRadius: 6, | ||
textAlign: 'center', | ||
typography: 'body2', | ||
...(onlyV3 | ||
? { | ||
color: theme.palette.text.primary, | ||
backgroundColor: theme.palette.background.paper, | ||
} | ||
: { | ||
color: theme.palette.text.secondary, | ||
backgroundColor: 'transparent', | ||
}), | ||
}} | ||
> | ||
{t`V3`} | ||
</Box> | ||
<Box | ||
sx={{ | ||
px: 12, | ||
py: 4, | ||
borderRadius: 6, | ||
textAlign: 'center', | ||
typography: 'body2', | ||
...(!onlyV3 | ||
? { | ||
color: theme.palette.text.primary, | ||
backgroundColor: theme.palette.background.paper, | ||
} | ||
: { | ||
color: theme.palette.text.secondary, | ||
backgroundColor: 'transparent', | ||
}), | ||
}} | ||
> | ||
{t`V2 & PMM`} | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
}; |
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