-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate to chakra #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
1242b99
f908c5d
8f1e601
3daf176
cc15996
dbe387c
dff7c0e
fae2c5f
c2e4ccc
ea6d644
d4960e4
b092ba4
d60b479
5c4c9df
d00257e
b1957ee
6f4fda4
a1d7240
2a3d571
1bb81f9
8d1592c
463b9ed
9a85570
fe347a4
9a10ac5
c04de38
8a32eb6
ae95afe
e486ccf
56057f2
fbec05f
7da7232
7bd89aa
1a7b1c6
b2ac35b
fa4e4b7
0136638
c8fff80
ac0bc17
7864bb3
7cc6b4e
658f95a
87eb76a
0f1fbbc
741d94c
9ac831f
1fc40b5
81bd103
1d76ae5
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,24 @@ | ||
--- | ||
name: Button | ||
--- | ||
|
||
import { Playground } from 'docz' | ||
import {Box} from '@chakra-ui/core' | ||
import Button from '../src/components/button.js' | ||
import ContactUsButton from '../src/components/contactUsButton.js' | ||
|
||
## Button | ||
<Playground> | ||
<Button>hi</Button> | ||
</Playground> | ||
|
||
## Contact us Button | ||
<Playground> | ||
<ContactUsButton /> | ||
</Playground> | ||
|
||
### Props | ||
| Props | default | | ||
|:-------|:------| | ||
| text | Contact Us| | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: Contact-form | ||
--- | ||
|
||
import { Playground } from 'docz' | ||
import ContactForm from '../src/components/contactForm.js' | ||
|
||
## Contact-form | ||
|
||
<Playground> | ||
<ContactForm /> | ||
</Playground> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: Development-services | ||
--- | ||
|
||
import { Playground } from 'docz' | ||
import DevelopmentServices from '../src/components/developmentServices.js' | ||
|
||
## Development-services | ||
|
||
<Playground> | ||
<DevelopmentServices /> | ||
</Playground> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Icons | ||
--- | ||
|
||
import { Playground } from 'docz' | ||
import ReactIcon from '../src/components/icons/React.js' | ||
|
||
## React Icon | ||
<Playground> | ||
<ReactIcon width='200px'/> | ||
</Playground> | ||
|
||
### Props | ||
|
||
| Props | Description | | ||
|:-------|:------| | ||
| width | Sets the width of the icon | | ||
| Height | Sets the Height of the icon | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: Libraries | ||
--- | ||
|
||
import { Playground } from 'docz' | ||
import Libraries from '../src/components/libraries.js' | ||
|
||
## Libraries | ||
|
||
<Playground> | ||
<Libraries /> | ||
</Playground> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import { Button as Btn } from '@chakra-ui/core'; | ||
|
||
const Button = (props) => ( | ||
<Btn | ||
borderRadius={3} | ||
variant="outline" | ||
bg='transparent' | ||
border='3px' | ||
py='1' | ||
h='auto' | ||
px='4' | ||
lineHeight='1' | ||
fontFamily='body' | ||
fontWeight='hairline' | ||
{...props} | ||
/> | ||
) | ||
|
||
export default Button |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
import {Link} from 'gatsby' | ||
import styled from '@emotion/styled' | ||
import {css} from 'bricks' | ||
import React from 'react' | ||
import { Link } from 'gatsby' | ||
import { PseudoBox } from '@chakra-ui/core'; | ||
|
||
export default styled(Link)( | ||
css({ | ||
bg: 'tint', | ||
color: 'black.1', | ||
fontSize:'0', | ||
px:'6px', | ||
py:'2px', | ||
display:'inline-block', | ||
borderRadius: '6px', | ||
border: '1px solid black', | ||
textDecoration: 'none', | ||
export default (props) => <PseudoBox | ||
as={Link} | ||
bg='tint' | ||
color='black.1' | ||
fontSize='0' | ||
px='6px' | ||
py='2px' | ||
display='inline-block' | ||
borderRadius='6px' | ||
border='1px solid black' | ||
textDecoration='none' | ||
lineHeight='0' | ||
_hover={{ | ||
bg:'black.1', | ||
color:'tint', | ||
}} | ||
_visited={{ | ||
bg:'tint', | ||
color:'black.1', | ||
'&:hover': { | ||
bg:'black.1', | ||
color:'tint', | ||
}, | ||
':visited':{ | ||
bg:'tint', | ||
color:'black.1', | ||
'&:hover': { | ||
bg:'black.1', | ||
color:'tint', | ||
}, | ||
} | ||
}) | ||
) | ||
}} | ||
{...props} | ||
/> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,47 @@ | ||
import React from "react" | ||
import { Flex, Box, InputText, OutlinedButton } from "bricks" | ||
import { Box, Input } from '@chakra-ui/core'; | ||
import Button from './button'; | ||
|
||
const ContactForm = ({ referrer }) => { | ||
return ( | ||
<form action="https://api.formik.com/submit/codebrahma/contact" method="post"> | ||
<input | ||
type="hidden" | ||
name="_next" | ||
value="https://codebrahma.com/thank-you" | ||
const ContactForm = ({ referrer }) => ( | ||
<form action="https://api.formik.com/submit/codebrahma/contact" method="post"> | ||
<input | ||
type="hidden" | ||
name="_next" | ||
value="https://codebrahma.com/thank-you" | ||
/> | ||
<input type="hidden" name="referrer" value={referrer} /> | ||
<Box width={[1, 1 / 2]}> | ||
<Input | ||
size="25" | ||
rows="5" | ||
required | ||
as="textarea" | ||
name="msg" | ||
backgroundColor="black.4" | ||
borderWidth={0} | ||
borderRadius={3} | ||
placeholder="💬 Tell us about your idea" | ||
padding={1} | ||
/> | ||
<input type="hidden" name="referrer" value={referrer} /> | ||
<Flex flexWrap="wrap" flexDirection="column"> | ||
<Box width={[1, 1 / 2]}> | ||
<InputText | ||
size="25" | ||
rows="5" | ||
width={1} | ||
required | ||
as="textarea" | ||
name="msg" | ||
backgroundColor="black.4" | ||
borderWidth={0} | ||
borderRadius={3} | ||
placeholder="💬 Tell us about your idea" | ||
/> | ||
</Box> | ||
<Box width={[1, 1 / 2]} mt={1}> | ||
<InputText | ||
width={1} | ||
name="email" | ||
type="email" | ||
required | ||
backgroundColor="black.4" | ||
borderWidth={0} | ||
borderRadius={3} | ||
placeholder="@ Email address" | ||
/> | ||
</Box> | ||
<Box width={[1, 1 / 3]} mt={1}> | ||
<OutlinedButton borderRadius={3}> | ||
Submit | ||
</OutlinedButton> | ||
</Box> | ||
</Flex> | ||
</form> | ||
) | ||
} | ||
</Box> | ||
<Box width={[1, 1 / 2]} mt={1}> | ||
<Input | ||
name="email" | ||
type="email" | ||
required | ||
backgroundColor="black.4" | ||
borderWidth={0} | ||
borderRadius={3} | ||
placeholder="@ Email address" | ||
lineHeight='1' | ||
padding={1} | ||
height='auto' | ||
/> | ||
</Box> | ||
<Box width={[1, 1 / 3]} mt={1}> | ||
<Button type='submit' variant='outline'>Submit</Button> | ||
</Box> | ||
</form> | ||
) | ||
|
||
export default ContactForm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
|
||
const ReactIcon = (props) => ( | ||
<svg width={props.width} height={props.height} version="1.1" id="Layer_2_1_" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" | ||
viewBox="0 0 841.9 595.3" enableBackground="new 0 0 841.9 595.3" > | ||
<g> | ||
<path fill="#333333" d="M666.3,296.5c0-32.5-40.7-63.3-103.1-82.4c14.4-63.6,8-114.2-20.2-130.4c-6.5-3.8-14.1-5.6-22.4-5.6v22.3 | ||
c4.6,0,8.3,0.9,11.4,2.6c13.6,7.8,19.5,37.5,14.9,75.7c-1.1,9.4-2.9,19.3-5.1,29.4c-19.6-4.8-41-8.5-63.5-10.9 | ||
c-13.5-18.5-27.5-35.3-41.6-50c32.6-30.3,63.2-46.9,84-46.9l0-22.3c0,0,0,0,0,0c-27.5,0-63.5,19.6-99.9,53.6 | ||
c-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7,0,51.4,16.5,84,46.6c-14,14.7-28,31.4-41.3,49.9c-22.6,2.4-44,6.1-63.6,11 | ||
c-2.3-10-4-19.7-5.2-29c-4.7-38.2,1.1-67.9,14.6-75.8c3-1.8,6.9-2.6,11.5-2.6l0-22.3c0,0,0,0,0,0c-8.4,0-16,1.8-22.6,5.6 | ||
c-28.1,16.2-34.4,66.7-19.9,130.1c-62.2,19.2-102.7,49.9-102.7,82.3c0,32.5,40.7,63.3,103.1,82.4c-14.4,63.6-8,114.2,20.2,130.4 | ||
c6.5,3.8,14.1,5.6,22.5,5.6c27.5,0,63.5-19.6,99.9-53.6c36.4,33.8,72.4,53.2,99.9,53.2c8.4,0,16-1.8,22.6-5.6 | ||
c28.1-16.2,34.4-66.7,19.9-130.1C625.8,359.7,666.3,328.9,666.3,296.5z M536.1,229.8c-3.7,12.9-8.3,26.2-13.5,39.5 | ||
c-4.1-8-8.4-16-13.1-24c-4.6-8-9.5-15.8-14.4-23.4C509.3,224,523,226.6,536.1,229.8z M490.3,336.3c-7.8,13.5-15.8,26.3-24.1,38.2 | ||
c-14.9,1.3-30,2-45.2,2c-15.1,0-30.2-0.7-45-1.9c-8.3-11.9-16.4-24.6-24.2-38c-7.6-13.1-14.5-26.4-20.8-39.8 | ||
c6.2-13.4,13.2-26.8,20.7-39.9c7.8-13.5,15.8-26.3,24.1-38.2c14.9-1.3,30-2,45.2-2c15.1,0,30.2,0.7,45,1.9 | ||
c8.3,11.9,16.4,24.6,24.2,38c7.6,13.1,14.5,26.4,20.8,39.8C504.7,309.8,497.8,323.2,490.3,336.3z M522.6,323.3 | ||
c5.4,13.4,10,26.8,13.8,39.8c-13.1,3.2-26.9,5.9-41.2,8c4.9-7.7,9.8-15.6,14.4-23.7C514.2,339.4,518.5,331.3,522.6,323.3z | ||
M421.2,430c-9.3-9.6-18.6-20.3-27.8-32c9,0.4,18.2,0.7,27.5,0.7c9.4,0,18.7-0.2,27.8-0.7C439.7,409.7,430.4,420.4,421.2,430z | ||
M346.8,371.1c-14.2-2.1-27.9-4.7-41-7.9c3.7-12.9,8.3-26.2,13.5-39.5c4.1,8,8.4,16,13.1,24C337.1,355.7,341.9,363.5,346.8,371.1z | ||
M420.7,163c9.3,9.6,18.6,20.3,27.8,32c-9-0.4-18.2-0.7-27.5-0.7c-9.4,0-18.7,0.2-27.8,0.7C402.2,183.3,411.5,172.6,420.7,163z | ||
M346.7,221.9c-4.9,7.7-9.8,15.6-14.4,23.7c-4.6,8-8.9,16-13,24c-5.4-13.4-10-26.8-13.8-39.8C318.6,226.7,332.4,224,346.7,221.9z | ||
M256.2,347.1c-35.4-15.1-58.3-34.9-58.3-50.6c0-15.7,22.9-35.6,58.3-50.6c8.6-3.7,18-7,27.7-10.1c5.7,19.6,13.2,40,22.5,60.9 | ||
c-9.2,20.8-16.6,41.1-22.2,60.6C274.3,354.2,264.9,350.8,256.2,347.1z M310,490c-13.6-7.8-19.5-37.5-14.9-75.7 | ||
c1.1-9.4,2.9-19.3,5.1-29.4c19.6,4.8,41,8.5,63.5,10.9c13.5,18.5,27.5,35.3,41.6,50c-32.6,30.3-63.2,46.9-84,46.9 | ||
C316.8,492.6,313,491.7,310,490z M547.2,413.8c4.7,38.2-1.1,67.9-14.6,75.8c-3,1.8-6.9,2.6-11.5,2.6c-20.7,0-51.4-16.5-84-46.6 | ||
c14-14.7,28-31.4,41.3-49.9c22.6-2.4,44-6.1,63.6-11C544.3,394.8,546.1,404.5,547.2,413.8z M585.7,347.1c-8.6,3.7-18,7-27.7,10.1 | ||
c-5.7-19.6-13.2-40-22.5-60.9c9.2-20.8,16.6-41.1,22.2-60.6c9.9,3.1,19.3,6.5,28.1,10.2c35.4,15.1,58.3,34.9,58.3,50.6 | ||
C644,312.2,621.1,332.1,585.7,347.1z"/> | ||
<polygon fill="#333333" points="320.8,78.4 320.8,78.4 320.8,78.4 "/> | ||
<circle fill="#333333" cx="420.9" cy="296.5" r="45.7"/> | ||
<polygon fill="#333333" points="520.5,78.1 520.5,78.1 520.5,78.1 "/> | ||
</g> | ||
</svg> | ||
) | ||
|
||
export default ReactIcon |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
import { H2 } from "bricks" | ||
import Link from "./link" | ||
import React from "react" | ||
import { H2 } from "../components/typography"; | ||
|
||
export const Logo = ({ title }) => ( | ||
<H2 marginTop={[0, 0]}> | ||
<Link | ||
to="/" | ||
style={{ | ||
textDecoration: `none`, | ||
}} | ||
> | ||
{title} | ||
</Link> | ||
<H2 marginTop={[0, 0]} > | ||
<Link to="/">{title}</Link> | ||
</H2> | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React, { useState } from 'react' | ||
import { Box, Flex, PseudoBox, Icon } from '@chakra-ui/core' | ||
import Link from './link' | ||
|
||
// TODO: mobile nav fix | ||
a-saran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const Nav = ({ logo, links,}) => { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
const mobileNav = { | ||
position: 'fixed', | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0, | ||
background: 'rgb(248, 244, 242)', | ||
overflowY: 'auto', | ||
zIndex: 1, | ||
flexDirection: 'column' | ||
} | ||
|
||
return ( | ||
<Flex justify='space-between' align='center' py={1}> | ||
{logo} | ||
<Flex display={['none', 'flex']} css={isOpen ? mobileNav : {}}> | ||
{links.map(({ link, title }) => ( | ||
<PseudoBox | ||
as={Link} | ||
px={1} | ||
to={link} | ||
key={link} | ||
fontFamily='body' | ||
fontSize={1} | ||
_hover={{ | ||
textDecoration: 'underline' | ||
}} | ||
> | ||
{title} | ||
</PseudoBox> | ||
))} | ||
</Flex> | ||
<Box display={['block', 'none']} p={1} onClick={() => setIsOpen(!isOpen)}> | ||
<Box height='3px' bg='primary' marginBottom='5px' width={'25px'}/> | ||
<Box height='3px' bg='primary' marginBottom='5px'/> | ||
<Box height='3px' bg='primary' marginBottom='5px'/> | ||
</Box> | ||
{isOpen && ( | ||
<Flex | ||
position='fixed' | ||
top='0' | ||
bottom='0' | ||
right='0' | ||
left='0' | ||
bg='secondary' | ||
flexDirection='column' | ||
align='center' | ||
zIndex='5' | ||
> | ||
<Flex p='2' justifyContent='flex-end' width='100%'> | ||
<Icon name="close" p='1' onClick={() => setIsOpen(false)}/> | ||
</Flex> | ||
{links.map(({ link, title }) => ( | ||
<Box | ||
as={Link} | ||
px={1} | ||
to={link} | ||
key={link} | ||
fontFamily='body' | ||
py={3} | ||
fontSize={'desktop.3'} | ||
userSelect='none' | ||
> | ||
{title} | ||
</Box> | ||
))} | ||
</Flex> | ||
)} | ||
</Flex> | ||
) | ||
} | ||
|
||
export default Nav |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,20 @@ | ||
import React from 'react'; | ||
import styled from '@emotion/styled'; | ||
import { fontFamily, fontSize, fontWeight, lineHeight, space, border } from 'styled-system'; | ||
import { Text } from '@chakra-ui/core'; | ||
|
||
export const withTitleStyle = (comp) => styled(comp)` | ||
${fontFamily} | ||
${fontSize} | ||
${fontWeight} | ||
${lineHeight} | ||
${space} | ||
${border} | ||
`; | ||
|
||
const Title = ({ comp, ...otherProps }) => { | ||
const TitleComponent = withTitleStyle(comp || 'span'); | ||
|
||
return ( | ||
<TitleComponent | ||
fontFamily="heading" | ||
fontSize={[4, 'desktop.4']} | ||
lineHeight={2} | ||
mt={[3, 4]} | ||
mb={1} | ||
px={0} | ||
pt={0} | ||
pb="2px" | ||
borderBottom={`1px solid`} | ||
borderColor="black.0" | ||
{...otherProps} | ||
/> | ||
); | ||
} | ||
const Title = (props) => ( | ||
<Text | ||
as='span' | ||
fontFamily="heading" | ||
fontSize={[4, 'desktop.4']} | ||
lineHeight={2} | ||
mt={[3, 4]} | ||
mb={1} | ||
p={0} | ||
pb="2px" | ||
borderBottom='1px' | ||
borderColor="black.0" | ||
{...props} | ||
/> | ||
); | ||
|
||
export default Title; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import React from 'react' | ||
import { PseudoBox } from '@chakra-ui/core'; | ||
|
||
const H1 = (props) => ( | ||
<PseudoBox | ||
as='h1' | ||
fontFamily='heading' | ||
fontSize={[5,'desktop.5']} | ||
lineHeight={3} | ||
mt={[3, 4]} | ||
mb={1} | ||
p={0} | ||
{...props} | ||
/> | ||
) | ||
const H2 = (props) => ( | ||
<PseudoBox | ||
as='h2' | ||
fontFamily='heading' | ||
fontSize={[4,'desktop.4']} | ||
lineHeight={2} | ||
mt={[3, 4]} | ||
mb={1} | ||
p={0} | ||
{...props} | ||
/> | ||
) | ||
const H3 = (props) => ( | ||
<PseudoBox | ||
as='h3' | ||
fontFamily='heading' | ||
fontSize={[3,'desktop.3']} | ||
lineHeight={1} | ||
mt={[2, 3]} | ||
mb={1} | ||
p={0} | ||
{...props} | ||
/> | ||
) | ||
const H4 = (props) => ( | ||
<PseudoBox | ||
as='h4' | ||
fontFamily='heading' | ||
fontSize={[2,'desktop.2']} | ||
lineHeight={1} | ||
mt={2} | ||
mb={1} | ||
p={0} | ||
{...props} | ||
/> | ||
) | ||
const H5 = (props) => ( | ||
<PseudoBox | ||
as='h4' | ||
fontFamily='heading' | ||
fontSize={[1,'desktop.1']} | ||
lineHeight={1} | ||
mt={2} | ||
mb={1} | ||
p={0} | ||
{...props} | ||
/> | ||
) | ||
|
||
const P = (props) => ( | ||
<PseudoBox | ||
as='p' | ||
lineHeight='1' | ||
fontSize={[1, 'desktop.1']} | ||
mb='2' | ||
{...props} | ||
/> | ||
) | ||
|
||
const B = (props) => ( | ||
<PseudoBox | ||
as='b' | ||
fontFamily='bold' | ||
{...props} | ||
/> | ||
) | ||
const Em = (props) => ( | ||
<PseudoBox | ||
as='em' | ||
fontFamily='italic' | ||
{...props} | ||
/> | ||
) | ||
|
||
const I = (props) => ( | ||
<PseudoBox | ||
as='i' | ||
fontFamily='italic' | ||
{...props} | ||
/> | ||
) | ||
|
||
const Ul = (props) => ( | ||
<PseudoBox | ||
as='ul' | ||
listStylePosition='inside' | ||
listStyleImage='none' | ||
listStyleType='disc' | ||
mb={2} | ||
{...props} | ||
/> | ||
) | ||
const Ol = (props) => ( | ||
<PseudoBox | ||
as='ol' | ||
listStylePosition='inside' | ||
listStyleImage='none' | ||
listStyleType='decimal' | ||
mb={2} | ||
{...props} | ||
/> | ||
) | ||
const Li = (props) => ( | ||
<PseudoBox | ||
as='li' | ||
fontFamily='body' | ||
fontSize={[1, 'desktop.1']} | ||
maxWidth="40rem" | ||
mb={1} | ||
{...props} | ||
/> | ||
) | ||
|
||
const Strong = (props) => ( | ||
<PseudoBox | ||
as='strong' | ||
fontFamily='bold' | ||
{...props} | ||
/> | ||
) | ||
|
||
export { | ||
H1, H2, H3, H4, H5, P, B, Em, I, Ul, Ol, Li, Strong | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { jsx } from '@emotion/core' | ||
/** @jsx jsx */ | ||
import styled from '@emotion/styled' | ||
import { PseudoBox, Box } from '@chakra-ui/core' | ||
import { H3, H4, P } from "../components/typography" | ||
import Layout from '../templates/layout' | ||
import { P, H3, H4, I, | ||
Box, Text, HorizontalRule } from 'bricks' | ||
import PlainLink from '../components/link' | ||
import { css } from 'bricks' | ||
import { Link } from 'gatsby' | ||
import { Helmet } from 'react-helmet' | ||
import Pagination from '../components/pagination' | ||
import { getCategory, getTags, slugify } from '../utils' | ||
import { space } from 'styled-system' | ||
import CategoryLink from '../components/categorylink' | ||
|
||
const isLast = (arr, index)=> arr.length-1 === index | ||
|
@@ -40,77 +38,80 @@ const getHeading = ({ | |
return `Blog Posts, page ${currentPage} of ${totalPages}`; | ||
}; | ||
|
||
const ReadPostLink = styled(Link)( | ||
css({ | ||
textAlign: 'center', | ||
width: '100%', | ||
borderRadius: '3px', | ||
p: '2px', | ||
display: 'inline-block', | ||
'&:hover':{ | ||
const ReadPostLink = (props) => ( | ||
<PseudoBox | ||
as={Link} | ||
textAlign='center' | ||
width='100%' | ||
borderRadius='3px' | ||
p='2px' | ||
display='inline-block' | ||
_hover={{ | ||
bg: 'black.1', | ||
color: 'tint', | ||
}, | ||
':visited':{ | ||
}} | ||
_visited={{ | ||
'&:hover':{ | ||
bg: 'black.1', | ||
color: 'tint', | ||
} | ||
} | ||
}) | ||
}} | ||
{...props} | ||
/> | ||
) | ||
|
||
const TagLink = styled(PlainLink)` | ||
display: inline-block; | ||
margin-right: 10px; | ||
` | ||
|
||
const HeadingLink = styled(Link)( | ||
space, | ||
css({ | ||
p: '5px', | ||
borderRadius:'5px', | ||
display: 'inline-block', | ||
textDecoration: 'none', | ||
'&:hover': { | ||
const HeadingLink = (props) => ( | ||
<PseudoBox | ||
as={Link} | ||
p='5px' | ||
borderRadius='5px' | ||
display='inline-block' | ||
textDecoration='none' | ||
_hover={{ | ||
backgroundColor: 'primary', | ||
color: 'secondary', | ||
} | ||
}) | ||
}} | ||
{...props} | ||
/> | ||
) | ||
|
||
// refactoring the Link beautifully with invert etc | ||
const Blog = ({frontmatter})=>( | ||
<Box> | ||
<H3> | ||
<HeadingLink ml='-5px' to={frontmatter.link}> | ||
{frontmatter.title } | ||
</HeadingLink> | ||
</H3> | ||
{getCategory(frontmatter) && ( | ||
<CategoryLink to={`/category/${slugify(getCategory(frontmatter))}`}> | ||
{getCategory(frontmatter)} | ||
</CategoryLink> | ||
)} | ||
<Box marginTop='2'> | ||
<P>{frontmatter.description}</P> | ||
<Box marginTop='1'> | ||
<Text fontSize={[0,0]} color='black.2'> | ||
{getTags(frontmatter) && getTags(frontmatter).map((tag,i)=> { | ||
const slug = slugify(tag) | ||
return ( | ||
<TagLink key={tag} to={`/tag/${slug}`}> | ||
<I>#{slug}</I> | ||
</TagLink> | ||
) | ||
})} | ||
</Text> | ||
</Box> | ||
</Box> | ||
<Box marginBottom={3} marginTop={1}> | ||
<ReadPostLink to={frontmatter.link}>Read Post</ReadPostLink> | ||
</Box> | ||
const Blog = ({ frontmatter })=>( | ||
<Box> | ||
<H3> | ||
<HeadingLink ml='-5px' to={frontmatter.link}> | ||
{frontmatter.title} | ||
</HeadingLink> | ||
</H3> | ||
{getCategory(frontmatter) && ( | ||
<CategoryLink to={`/category/${slugify(getCategory(frontmatter))}`}> | ||
{getCategory(frontmatter)} | ||
</CategoryLink> | ||
)} | ||
<Box marginTop='2'> | ||
<P>{frontmatter.description}</P> | ||
<Box marginTop='1'> | ||
<P fontSize={[0,0]} color='black.2'> | ||
{getTags(frontmatter) && getTags(frontmatter).map((tag,i)=> { | ||
const slug = slugify(tag) | ||
return ( | ||
<TagLink key={tag} to={`/tag/${slug}`}> | ||
<I>#{slug}</I> | ||
</TagLink> | ||
) | ||
})} | ||
</P> | ||
</Box> | ||
</Box> | ||
<Box marginBottom={3} marginTop={1}> | ||
<ReadPostLink to={frontmatter.link}>Read Post</ReadPostLink> | ||
</Box> | ||
</Box> | ||
|
||
) | ||
|
||
|
@@ -139,24 +140,27 @@ const JournalPage = ({ | |
value, | ||
}) | ||
} /> | ||
<H4 css={css({color: 'black.1'})}> | ||
{getHeading({ | ||
isFirstPage, | ||
currentPage, | ||
totalPages, | ||
type, | ||
value, | ||
})}</H4> | ||
<Box marginTop={6} width={[1, 2/3]}> | ||
<H4 color='black.1'> | ||
{getHeading({ | ||
isFirstPage, | ||
currentPage, | ||
totalPages, | ||
type, | ||
value, | ||
})} | ||
</H4> | ||
<Box marginTop={6} width={['100%', 2/3]}> | ||
{blogs.map((blog,i) => ( | ||
<div key={blog.childMdx.frontmatter.title}> | ||
<Blog frontmatter={blog.childMdx.frontmatter} /> | ||
{ isLast(blogs, i)? '': | ||
<HorizontalRule | ||
width={1} | ||
borderWidth={1} | ||
borderColor={'black.3'} | ||
/> | ||
{ isLast(blogs, i) | ||
? '' | ||
: ( | ||
<Box | ||
height={'1px'} | ||
bg={'black.3'} | ||
/> | ||
) | ||
} | ||
</div> | ||
))} | ||
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.
Seems styles are missing in 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. yes, blog pages are loading from @codebrahma/gatsby-theme-blog package, theme is hardcoded in that package. I am working on it |
||
|
Uh oh!
There was an error while loading. Please reload this page.