-
Notifications
You must be signed in to change notification settings - Fork 70
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) { | ||
|
||
| 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; | ||
| `; | ||
|
Contributor
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
Contributor
Author
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