parent
7e0a392a87
commit
6bb1505db3
8 changed files with 67 additions and 41 deletions
@ -1,18 +1,26 @@ |
||||
import React from 'react'; |
||||
import { Link } from '@chakra-ui/react'; |
||||
import styled from 'styled-components'; |
||||
|
||||
type EnrichedLinkProps = { |
||||
href: string; |
||||
children: React.ReactNode |
||||
} |
||||
|
||||
export default function EnrichedLink(props: EnrichedLinkProps) { |
||||
const Link = styled.a` |
||||
font-weight: 600; |
||||
text-decoration: underline; |
||||
`;
|
||||
|
||||
const EnrichedLink = (props: EnrichedLinkProps) => { |
||||
// Is external URL or is a media URL
|
||||
const isExternalUrl = /(^http(s)?:\/\/)|(\.(png|svg|jpeg|jpg)$)/.test(props.href); |
||||
|
||||
return ( |
||||
<Link fontWeight={600} href={props.href} target={isExternalUrl ? '_blank' : '_self'} textDecoration='underline'> |
||||
<Link href={props.href} target={isExternalUrl ? '_blank' : '_self'}> |
||||
{props.children} |
||||
</Link> |
||||
); |
||||
}; |
||||
|
||||
export default EnrichedLink; |
||||
|
||||
|
@ -1,14 +0,0 @@ |
||||
import React from 'react'; |
||||
import { ListItem, UnorderedList } from '@chakra-ui/react'; |
||||
|
||||
type LiProps = { |
||||
children: React.ReactNode; |
||||
}; |
||||
|
||||
export default function Li(props: LiProps) { |
||||
return ( |
||||
<ListItem mb='7px'> |
||||
{props.children} |
||||
</ListItem> |
||||
); |
||||
} |
@ -1,10 +1,14 @@ |
||||
import React from 'react'; |
||||
import { Text } from '@chakra-ui/react'; |
||||
import styled from 'styled-components'; |
||||
|
||||
type EnrichedTextType = { |
||||
children: React.ReactNode; |
||||
} |
||||
|
||||
export default function EnrichedText(props: EnrichedTextType) { |
||||
return <Text lineHeight='27px' fontSize='16px' color='black' mb='18px'>{props.children}</Text>; |
||||
} |
||||
export const P = styled.p` |
||||
line-height: 27px; |
||||
font-size: 16px; |
||||
color: black; |
||||
margin-bottom: 18px; |
||||
`;
|
||||
|
@ -1,14 +1,12 @@ |
||||
import React from 'react'; |
||||
import { UnorderedList } from '@chakra-ui/react'; |
||||
import styled from 'styled-components'; |
||||
|
||||
type OlProps = { |
||||
children: React.ReactNode; |
||||
}; |
||||
export const Ul = styled.ul` |
||||
margin-left: 40px; |
||||
margin-bottom: 18px; |
||||
`;
|
||||
|
||||
export default function Ul(props: OlProps) { |
||||
return ( |
||||
<UnorderedList ml='40px' mb='18px'> |
||||
{props.children} |
||||
</UnorderedList> |
||||
); |
||||
} |
||||
export const Li = styled.li` |
||||
margin-bottom: 7px; |
||||
`;
|
||||
|
Loading…
Reference in new issue