parent
8f25dce7cb
commit
5a70d78819
@ -1,18 +0,0 @@
|
||||
import React from 'react'
|
||||
import { ChakraProps, Box } from '@chakra-ui/core'
|
||||
|
||||
import { ReactComponent as LogoSVG } from '../images/header/logo.svg'
|
||||
|
||||
interface LogoProps {
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
const Logo: React.FC = (props) => {
|
||||
return <LogoSVG {...props} />
|
||||
}
|
||||
|
||||
const StyledLogo: React.FC<ChakraProps & LogoProps> = (props) => {
|
||||
return <Box as={Logo} {...props} />
|
||||
}
|
||||
|
||||
export default StyledLogo
|
@ -0,0 +1,105 @@
|
||||
import { Spacer, Stack, Heading, Text, Box, Flex } from '@chakra-ui/react'
|
||||
|
||||
import ResponsiveImage from 'components/ResponsiveImage'
|
||||
import SEO from 'components/SEO'
|
||||
|
||||
import { getAllWorks, getWorkWithImages, IWorkWithImages, login } from 'lib/api'
|
||||
|
||||
const Work: React.FC<{ data: IWorkWithImages }> = ({ data }) => {
|
||||
return (
|
||||
<>
|
||||
<SEO title="work" />
|
||||
<ResponsiveImage
|
||||
url={`work/${data.banner_file}`}
|
||||
alt={`Imagen de ${data.titulo}`}
|
||||
w="100%"
|
||||
minH="580px"
|
||||
maxH="70vh"
|
||||
mb="1rem"
|
||||
/>
|
||||
<Box w={['100%', '100%', '1220px']} pt="2rem" px="1rem" mx="auto">
|
||||
<Flex pb="4rem">
|
||||
<Box>
|
||||
<Heading as="h3" fontSize="xl" pb="0.5rem">
|
||||
{data.titulo}
|
||||
</Heading>
|
||||
<Stack fontSize="md" spacing="1rem" direction="row">
|
||||
{data.tags.map((tag) => (
|
||||
<Text fontSize="md" key={tag}>
|
||||
{tag}
|
||||
</Text>
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
<Spacer />
|
||||
<Flex direction="column" w="40%">
|
||||
<Stack
|
||||
direction="row"
|
||||
wrap="wrap"
|
||||
spacing="0"
|
||||
justify="space-between"
|
||||
pb="6rem"
|
||||
>
|
||||
<Box fontSize="md">
|
||||
<Heading fontSize="inherit" as="h4" pb="0.5rem">
|
||||
Cliente
|
||||
</Heading>
|
||||
<Text>{data.cliente}</Text>
|
||||
</Box>
|
||||
<Box fontSize="md">
|
||||
<Heading fontSize="inherit" as="h4" pb="0.5rem">
|
||||
País
|
||||
</Heading>
|
||||
<Text>{data.pais}</Text>
|
||||
</Box>
|
||||
<Box fontSize="md">
|
||||
<Heading fontSize="inherit" as="h4" pb="0.5rem">
|
||||
Año
|
||||
</Heading>
|
||||
<Text>{data.year}</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
<Box w="100%" h="8px" mb="calc(2rem + 8px)">
|
||||
<Box display="inline-block" w="60%" h="100%" bg={data.color1} />
|
||||
<Box display="inline-block" w="15%" h="100%" bg={data.color2} />
|
||||
</Box>
|
||||
<Heading as="h4" fontSize="md" pb="1rem">
|
||||
El proyecto
|
||||
</Heading>
|
||||
<Text fontSize="lg">{data.texto_descripcion}</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
{data.imagenes_files.map((imagen, index) => (
|
||||
<ResponsiveImage
|
||||
key={imagen}
|
||||
width="100%"
|
||||
height="auto"
|
||||
url={`work/${imagen}`}
|
||||
alt={`Imagen ${index} ilustrativa de ${data.titulo}`}
|
||||
mb="2rem"
|
||||
/>
|
||||
))}
|
||||
</Box>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Work
|
||||
|
||||
export async function getStaticPaths() {
|
||||
await login()
|
||||
const works = await getAllWorks()
|
||||
|
||||
return {
|
||||
paths: works.data.map((work) => `/work/${work.slug}`),
|
||||
fallback: false,
|
||||
}
|
||||
}
|
||||
|
||||
export async function getStaticProps({ params }) {
|
||||
await login()
|
||||
|
||||
const workWithImages = await getWorkWithImages(params.slug)
|
||||
|
||||
return { props: { data: workWithImages } }
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
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 ResponsiveImage from 'components/ResponsiveImage'
|
||||
import SEO from 'components/SEO'
|
||||
|
||||
import { getAllWorksWithBanners, IWorkWithBanner, login } from '../lib/api'
|
||||
import { getAllWorksWithBanners, IWorkWithBanner, login } from 'lib/api'
|
||||
|
||||
const Work: React.FC<{ data: IWorkWithBanner[] }> = ({ data }) => {
|
||||
return (
|
Loading…
Reference in new issue