parent
508c1f0f0d
commit
1f6f005922
@ -0,0 +1,56 @@
|
||||
import { Stack, Heading, Text, Box, Flex, Link as ChakraLink } from '@chakra-ui/react'
|
||||
import Link from 'next/link'
|
||||
|
||||
import ResponsiveImage from '../components/ResponsiveImage'
|
||||
import SEO from '../components/SEO'
|
||||
|
||||
import { getAllWorksWithBanners, IWorkWithBanner, login } from '../lib/api'
|
||||
|
||||
const Work: React.FC<{ data: IWorkWithBanner[] }> = ({ data }) => {
|
||||
return (
|
||||
<>
|
||||
<SEO title="work" />
|
||||
<Box w={['100%', '100%', '1170px']} pt="2rem" px="1rem" mx="auto">
|
||||
<Heading fontSize={['3xl', '3xl', '7xl']} mb="3rem">
|
||||
Work y cositas
|
||||
</Heading>
|
||||
<Flex wrap="wrap">
|
||||
{data.map((item, index) => (
|
||||
<Link href={`/work/${item.slug}`} passHref key={item.slug}>
|
||||
<ChakraLink w={index === 0 ? '100%' : '50%'} pb="4rem" px="1rem">
|
||||
<Box>
|
||||
<ResponsiveImage
|
||||
url={`work/${item.banner_file}`}
|
||||
alt={`Imagen de ${item.titulo}`}
|
||||
w="100%"
|
||||
h="100%"
|
||||
borderRadius="primary"
|
||||
mb="1rem"
|
||||
/>
|
||||
<Heading as="h3" fontSize="xl" pb="0.5rem">
|
||||
{item.titulo}
|
||||
</Heading>
|
||||
<Stack fontSize="md" spacing="1rem" direction="row">
|
||||
{item.tags.map((tag) => (
|
||||
<Text key={tag}>{tag}</Text>
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
</ChakraLink>
|
||||
</Link>
|
||||
))}
|
||||
</Flex>
|
||||
</Box>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Work
|
||||
|
||||
export async function getStaticProps() {
|
||||
await login()
|
||||
|
||||
const worksWithBanners = await getAllWorksWithBanners()
|
||||
|
||||
return { props: { data: worksWithBanners } }
|
||||
}
|
Loading…
Reference in new issue