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