-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Levana-Protocol/perp-4037/display-bets
PERP-4037 | Display bets
- Loading branch information
Showing
23 changed files
with
628 additions
and
149 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { SvgIcon, SvgIconProps } from '@mui/joy' | ||
|
||
const ErrorNotificationIcon = (props: SvgIconProps) => { | ||
const Svg = () => ( | ||
<g> | ||
<circle cx="27" cy="27" r="27" fill="#E52574"/> | ||
<circle opacity="0.5" cx="27" cy="27" r="19.5" stroke="white" strokeWidth="3"/> | ||
<rect x="19" y="20.0728" width="4" height="6" rx="2" fill="#D9D9D9"/> | ||
<rect x="31" y="20.0728" width="4" height="6" rx="2" fill="#D9D9D9"/> | ||
<path d="M21 34.5728V34.5728C24.4495 33.5777 28.0219 33.0728 31.612 33.0728H33" stroke="#D9D9D9" strokeWidth="3" strokeLinecap="round"/> | ||
</g> | ||
) | ||
|
||
return ( | ||
<SvgIcon {...props} viewBox="0 0 54 54"> | ||
<Svg /> | ||
</SvgIcon> | ||
) | ||
} | ||
|
||
export { ErrorNotificationIcon } |
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,19 @@ | ||
import { SvgIcon, SvgIconProps } from '@mui/joy' | ||
|
||
const SuccessNotificationIcon = (props: SvgIconProps) => { | ||
const Svg = () => ( | ||
<g> | ||
<circle cx="27" cy="27" r="27" fill="#44C194"/> | ||
<circle opacity="0.5" cx="26.9997" cy="27" r="19.9773" stroke="white" strokeWidth="3"/> | ||
<path d="M21.4775 28.1206L22.6685 29.3892C23.638 30.422 25.2781 30.422 26.2476 29.3892L32.523 22.7046" stroke="white" strokeWidth="3" strokeLinecap="round"/> | ||
</g> | ||
) | ||
|
||
return ( | ||
<SvgIcon {...props} viewBox="0 0 54 54"> | ||
<Svg /> | ||
</SvgIcon> | ||
) | ||
} | ||
|
||
export { SuccessNotificationIcon } |
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,15 @@ | ||
import { SvgIcon, SvgIconProps } from '@mui/joy' | ||
|
||
const TickIcon = (props: SvgIconProps) => { | ||
const Svg = () => ( | ||
<path d="M8.79496 15.875L4.62496 11.705L3.20496 13.115L8.79496 18.705L20.795 6.705L19.385 5.295L8.79496 15.875Z" /> | ||
) | ||
|
||
return ( | ||
<SvgIcon {...props} viewBox="0 0 24 24"> | ||
<Svg /> | ||
</SvgIcon> | ||
) | ||
} | ||
|
||
export { TickIcon } |
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,18 @@ | ||
import { SvgIcon, SvgIconProps } from '@mui/joy' | ||
|
||
const WarningNotificationIcon = (props: SvgIconProps) => { | ||
const Svg = () => ( | ||
<g> | ||
<circle cx="27" cy="27" r="27" fill="#FFB82E"/> | ||
<circle opacity="0.5" cx="27" cy="27" r="19.5" stroke="white" strokeWidth="3"/> | ||
</g> | ||
) | ||
|
||
return ( | ||
<SvgIcon {...props} viewBox="0 0 54 54"> | ||
<Svg /> | ||
</SvgIcon> | ||
) | ||
} | ||
|
||
export { WarningNotificationIcon } |
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
frontend/src/components/lib/Copyable/ErrorButton/index.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 { Button, ButtonProps } from '@mui/joy' | ||
|
||
import { CopyIcon } from '@assets/icons/Copy' | ||
import { TickIcon } from '@assets/icons/Tick' | ||
import { getErrorReport } from '@utils/errors' | ||
import { mergeSx } from '@utils/styles' | ||
import { useCopyToClipboard } from '@utils/hooks' | ||
|
||
interface CopyableErrorButtonProps<T> extends Omit<ButtonProps, "children" | "onClick"> { | ||
error: T, | ||
} | ||
|
||
const CopyableErrorButton = <T,>(props: CopyableErrorButtonProps<T>) => { | ||
const { error, ...buttonProps } = props | ||
const [copied, copy] = useCopyToClipboard() | ||
|
||
return ( | ||
<Button | ||
size="sm" | ||
variant="plain" | ||
color="neutral" | ||
startDecorator={copied ? <TickIcon fontSize="sm" /> : <CopyIcon fontSize="sm" />} | ||
aria-label="Copy error report to clipboard" | ||
{...buttonProps} | ||
sx={mergeSx({ minHeight: 0, p: 0 }, buttonProps.sx)} | ||
onClick={() => { | ||
const report = getErrorReport(error) | ||
copy(report) | ||
}} | ||
> | ||
{copied ? "Copied error report" : "Copy error report"} | ||
</Button> | ||
) | ||
} | ||
|
||
export { CopyableErrorButton, type CopyableErrorButtonProps } |
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,34 @@ | ||
import { Typography, TypographyProps } from '@mui/joy' | ||
|
||
import { mergeSx } from '@utils/styles' | ||
import { useCopyToClipboard } from '@utils/hooks' | ||
|
||
interface CopyableTextProps extends Omit<TypographyProps, "children" | "onClick"> { | ||
text: string, | ||
notificationText?: string, | ||
} | ||
|
||
const CopyableText = (props: CopyableTextProps) => { | ||
const { text, notificationText, ...typographyProps } = props | ||
const [, copy] = useCopyToClipboard() | ||
|
||
return ( | ||
<Typography | ||
onClick={() => { | ||
copy(text, notificationText ?? text) | ||
}} | ||
{...typographyProps} | ||
sx={mergeSx( | ||
{ | ||
cursor: "pointer", | ||
py: 1, | ||
}, | ||
typographyProps.sx, | ||
)} | ||
> | ||
{text} | ||
</Typography> | ||
) | ||
} | ||
|
||
export { CopyableText, type CopyableTextProps} |
Oops, something went wrong.