-
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.
- Loading branch information
1 parent
a73c470
commit deafb7f
Showing
16 changed files
with
385 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use client' | ||
|
||
import { Button, useToast, VStack } from '@chakra-ui/react' | ||
import { useDisclosure } from '@chakra-ui/hooks' | ||
import { StaticToast, StaticToastRenderProps } from '@repo/lib/shared/components/toasts/StaticToast' | ||
import { useCurrentDate } from '@repo/lib/shared/hooks/date.hooks' | ||
import { Toast } from '@repo/lib/shared/components/toasts/Toast' | ||
|
||
function ToastRender({ id, title, isClosable, onClose }: StaticToastRenderProps) { | ||
return <Toast id={id} isClosable={isClosable} onClose={onClose} title={title} /> | ||
} | ||
|
||
const start = Date.now() | ||
|
||
export default function Page() { | ||
const { isOpen, onOpen, onClose } = useDisclosure() | ||
const now = Number(useCurrentDate(100)) | ||
|
||
const showToast = useToast() | ||
|
||
return ( | ||
<VStack width="full"> | ||
<StaticToast | ||
isClosable | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
title={`Toast Text (${((now - start) / 1000).toFixed(1)})`} | ||
> | ||
{ToastRender} | ||
</StaticToast> | ||
|
||
<Button onClick={isOpen ? onClose : onOpen}> | ||
{isOpen ? 'Close Static Toast' : 'Open Static Toast'} | ||
</Button> | ||
|
||
<Button | ||
onClick={() => showToast({ title: 'Basic toast', render: props => <Toast {...props} /> })} | ||
> | ||
Show basic toast | ||
</Button> | ||
</VStack> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
65 changes: 65 additions & 0 deletions
65
packages/lib/modules/vebal/vote/my-votes/MyVotesHintModal.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,65 @@ | ||
'use client' | ||
|
||
import { SuccessOverlay } from '@repo/lib/shared/components/modals/SuccessOverlay' | ||
import { | ||
Modal, | ||
ModalContent, | ||
ModalCloseButton, | ||
ModalBody, | ||
Box, | ||
ModalHeader, | ||
VStack, | ||
Image, | ||
} from '@chakra-ui/react' | ||
import { UseDisclosureProps } from '@chakra-ui/hooks' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
export function MyVotesHintModal({ isOpen = false, onClose = () => {} }: UseDisclosureProps) { | ||
return ( | ||
<Modal isCentered isOpen={isOpen} onClose={onClose} size="lg"> | ||
<SuccessOverlay /> | ||
<ModalContent> | ||
<ModalHeader>How it works</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody pb="lg"> | ||
<VStack gap="lg"> | ||
<Image | ||
alt="How it works" | ||
objectFit="cover" | ||
rounded="md" | ||
shadow="md" | ||
src="/images/votes/how-it-works-bg.png" | ||
/> | ||
<Box as="ul" color="font.primary" listStylePosition="outside" pl="lg"> | ||
<li> | ||
Your vote directs liquidity mining emissions for the future periods starting next | ||
Thursday at 0:00 UTC. | ||
</li> | ||
<li> | ||
There are vote incentives offered by 3rd parties (also known as bribes). If you vote | ||
on pools with bribes, you can claim these bribes on third party platforms like | ||
Hidden Hand and Paladin. | ||
</li> | ||
<li> | ||
You can vote on multiple pools in a single transaction. Simply add multiple pools to | ||
your vote list. | ||
</li> | ||
<li> | ||
Votes are timelocked for 10 days. If you vote now, no edits can be made until 8 | ||
September 2024. | ||
</li> | ||
<li> | ||
Voting power is set at the time of a vote. If you get more veBAL later, resubmit | ||
your vote to use your increased power. | ||
</li> | ||
<li> | ||
After you get veBAL, it can be synced to supported L2 networks to boost BAL | ||
liquidity incentives on eligible pools. | ||
</li> | ||
</Box> | ||
</VStack> | ||
</ModalBody> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} |
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 |
---|---|---|
|
@@ -1013,4 +1013,4 @@ export const LiquidityGaugeV5Abi = [ | |
}, | ||
], | ||
}, | ||
] | ||
] as const |
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
96 changes: 96 additions & 0 deletions
96
packages/lib/shared/components/icons/BatteryChargeIcon.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,96 @@ | ||
import { SVGProps } from 'react' | ||
|
||
interface Props extends SVGProps<SVGSVGElement> { | ||
percentage: number | ||
} | ||
|
||
export function BatteryChargeIcon({ percentage, ...props }: Props) { | ||
const colors = { | ||
1: '#F48975', | ||
2: '#FDBA74', | ||
3: '#25E2A4', | ||
4: '#25E2A4', | ||
} | ||
|
||
function getCount() { | ||
if (percentage >= 90) { | ||
return 4 | ||
} | ||
if (percentage >= 75) { | ||
return 3 | ||
} | ||
if (percentage >= 50) { | ||
return 2 | ||
} | ||
return 1 | ||
} | ||
|
||
const count = getCount() | ||
|
||
return ( | ||
<svg | ||
color={colors[count]} | ||
fill="none" | ||
height="28" | ||
viewBox="0 0 28 28" | ||
width="28" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<g clipPath="url(#clip0_620_3003)"> | ||
<path | ||
d="M7.0013 8.16406H19.8346C20.4535 8.16406 21.047 8.4099 21.4845 8.84748C21.9221 9.28506 22.168 9.87856 22.168 10.4974V11.0807C22.168 11.2354 22.2294 11.3838 22.3388 11.4932C22.4482 11.6026 22.5966 11.6641 22.7513 11.6641C22.906 11.6641 23.0544 11.7255 23.1638 11.8349C23.2732 11.9443 23.3346 12.0927 23.3346 12.2474V15.7474C23.3346 15.9021 23.2732 16.0505 23.1638 16.1599C23.0544 16.2693 22.906 16.3307 22.7513 16.3307C22.5966 16.3307 22.4482 16.3922 22.3388 16.5016C22.2294 16.611 22.168 16.7594 22.168 16.9141V17.4974C22.168 18.1162 21.9221 18.7097 21.4845 19.1473C21.047 19.5849 20.4535 19.8307 19.8346 19.8307H7.0013C6.38246 19.8307 5.78897 19.5849 5.35139 19.1473C4.9138 18.7097 4.66797 18.1162 4.66797 17.4974V10.4974C4.66797 9.87856 4.9138 9.28506 5.35139 8.84748C5.78897 8.4099 6.38246 8.16406 7.0013 8.16406Z" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
|
||
{count > 0 && ( | ||
<path | ||
d="M8.16797 11.6641V16.3307" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
)} | ||
|
||
{count > 1 && ( | ||
<path | ||
d="M11.668 11.6641V16.3307" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
)} | ||
|
||
{count > 2 && ( | ||
<path | ||
d="M15.168 11.6641V16.3307" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
)} | ||
|
||
{count > 3 && ( | ||
<path | ||
d="M18.668 11.6641V16.3307" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
/> | ||
)} | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_620_3003"> | ||
<rect fill="white" height="28" rx="14" width="28" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
) | ||
} |
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,50 @@ | ||
import { SVGProps } from 'react' | ||
|
||
export function MagicStickIcon(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg | ||
fill="none" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<g clipPath="url(#clip0_339_6358)"> | ||
<path | ||
d="M4 14L14 4L12 2L2 12L4 14Z" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.33333" | ||
/> | ||
<path | ||
d="M10 4L12 6" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.33333" | ||
/> | ||
<path | ||
d="M5.9974 2C5.9974 2.35362 6.13787 2.69276 6.38792 2.94281C6.63797 3.19286 6.97711 3.33333 7.33073 3.33333C6.97711 3.33333 6.63797 3.47381 6.38792 3.72386C6.13787 3.97391 5.9974 4.31304 5.9974 4.66667C5.9974 4.31304 5.85692 3.97391 5.60687 3.72386C5.35682 3.47381 5.01768 3.33333 4.66406 3.33333C5.01768 3.33333 5.35682 3.19286 5.60687 2.94281C5.85692 2.69276 5.9974 2.35362 5.9974 2Z" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.33333" | ||
/> | ||
<path | ||
d="M12.6654 8.66797C12.6654 9.02159 12.8058 9.36073 13.0559 9.61078C13.3059 9.86083 13.6451 10.0013 13.9987 10.0013C13.6451 10.0013 13.3059 10.1418 13.0559 10.3918C12.8058 10.6419 12.6654 10.981 12.6654 11.3346C12.6654 10.981 12.5249 10.6419 12.2748 10.3918C12.0248 10.1418 11.6857 10.0013 11.332 10.0013C11.6857 10.0013 12.0248 9.86083 12.2748 9.61078C12.5249 9.36073 12.6654 9.02159 12.6654 8.66797Z" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.33333" | ||
/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_339_6358"> | ||
<rect fill="white" height="16" width="16" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
) | ||
} |
Oops, something went wrong.