-
Notifications
You must be signed in to change notification settings - Fork 75
Alert component #1245
base: dev
Are you sure you want to change the base?
Alert component #1245
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { InfoIcon } from '@chakra-ui/icons'; | ||
import { Container, Fade, Text } from '@chakra-ui/react'; | ||
|
||
interface AlterProps { | ||
text: string; | ||
} | ||
|
||
export default function Alert({ text }: AlterProps) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good start on this. Looking at this design here, it looks like we have primary, secondary, tertiary variants and success, info, warning and error states. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also haven't had a convo with @bachstatter or @noisekit about it, but it would be good by default if we have the option to pass a style object to all our primitives There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah didn't knew that this file existed! I was doing the component based of the burn flow in a different file. Well there is plenty to add here. Will do, thanks! |
||
return ( | ||
<Fade in={true}> | ||
<Container | ||
borderLeftWidth={5} | ||
borderLeftStyle="solid" | ||
borderLeftColor="cyan.500" | ||
borderRadius={5} | ||
display="flex" | ||
alignItems="center" | ||
padding={1} | ||
paddingLeft={3} | ||
bg="blue.900" | ||
> | ||
<InfoIcon w={4} h={4} color="cyan.500" marginRight={3} /> | ||
<Text fontSize="sm" fontFamily="body"> | ||
{text} | ||
</Text> | ||
</Container> | ||
</Fade> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { InfoIcon } from '@chakra-ui/icons'; | ||
import { Badge, BadgeProps, Flex, Text } from '@chakra-ui/react'; | ||
import { PropsWithChildren } from 'react'; | ||
import styled from 'styled-components'; | ||
import { motion } from 'framer-motion'; | ||
|
||
interface InputBadgeProps { | ||
colorScheme?: BadgeProps['colorScheme']; | ||
text: string; | ||
onClickIcon?: () => void; | ||
onClick?: () => void; | ||
} | ||
|
||
export default function InputBadge({ | ||
colorScheme, | ||
text, | ||
onClickIcon, | ||
onClick, | ||
}: PropsWithChildren<InputBadgeProps>) { | ||
return ( | ||
<StyledAnimatedWrapper animate={{ x: 100 }} transition={{ ease: 'easeOut', duration: 1 }}> | ||
<Badge colorScheme={colorScheme} padding="1.5" onClick={onClick} minW={170}> | ||
<Flex justify="space-between" align="center"> | ||
<Text fontSize="xs" color="cyan.500" fontFamily="body"> | ||
{text} | ||
</Text> | ||
{onClickIcon && <InfoIcon w={4} h={4} color="cyan.500" onClick={onClickIcon} />} | ||
</Flex> | ||
</Badge> | ||
</StyledAnimatedWrapper> | ||
); | ||
} | ||
|
||
const StyledAnimatedWrapper = styled(motion.div)` | ||
min-width: 170px; | ||
border: 1px solid black; | ||
cursor: pointer; | ||
`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as on the last PR, lets figure out how to style this without styled components There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed it in the last PR. Will be resolved here as well when merged. This branch is branched off the other one. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Head from 'next/head'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export default function BurnDebt() { | ||
const { t } = useTranslation(); | ||
return ( | ||
<> | ||
<Head> | ||
<title>{t('burn.title')}</title> | ||
</Head> | ||
</> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import dynamic from 'next/dynamic'; | ||
import GlobalLoader from 'components/GlobalLoader'; | ||
|
||
const BurnPage = dynamic(() => import('content/BurnPage'), { | ||
ssr: false, | ||
loading: GlobalLoader, | ||
}); | ||
|
||
export default BurnPage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks