Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions components/CardTech.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import React, { useState } from 'react';
import {
AvatarGroup,
Avatar,
Collapse,
Link,
Flex,
Image,
useColorMode,
} from '@chakra-ui/core';
import { Text } from '../components';

interface Props {
image: string;
title: string;
description: string;
}

const CardTech: React.FC<Props> = ({ image, title, description }) => {
const [show, setShow] = useState(false);
const handleToggle = () => setShow(!show);

const { colorMode } = useColorMode();
const avatars = [
{ name: 'logo', image: '../branding/logo_compact.svg' },
{ name: 'logo', image: '../branding/logo_compact.svg' },
];
return (
<Flex
onMouseOver={handleToggle}
onMouseOut={handleToggle}
w={['20rem', '40rem', '46rem', '46rem', '52rem']}
p={['1rem', '2rem', '2.2rem', '2.5rem', '2.5rem']}
display="flex"
borderColor="#f26840"
borderWidth="0.08rem"
borderRadius="0.2rem"
bg={colorMode === 'light' ? 'gray.300' : 'gray.800'}
mt="3rem"
h={['7.5rem', '14rem', '16rem', '16rem', '18rem']}
>
<Flex w="30%">
<Image src={image} />
</Flex>
<Flex
pl={['0.5rem', '2rem', '2.2rem', '2.5rem', '2.5rem']}
w="70%"
flexDirection="column"
justifyContent="space-between"
>
<Flex flexDirection="column">
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Poppins"
fontWeight="500"
fontSize={['1.2rem', '1.2rem', '2rem', '2.4rem', '2.8rem']}
>
{title}
</Text>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Public Sans"
fontSize={['0.9rem', '0.9rem', '1rem', '1rem', '1.4rem']}
overflow="hidden"
textOverflow="ellipsis"
whiteSpace="nowrap"
>
{description}
</Text>
</Flex>
<Flex justifyContent="space-between" w="100%">
<AvatarGroup>
{avatars.map((avatar, index) => (
<Avatar
key={index}
bg={colorMode === 'light' ? 'gray.300' : 'gray.800'}
w={['0%', '2.2rem', '2.2rem', '2.5rem', '3rem']}
h={['0%', '2.2rem', '2.2rem', '2.5rem', '3rem']}
name={avatar.name}
src={avatar.image}
/>
))}
</AvatarGroup>

<Flex>
<Link mt="0.3rem" _hover={{ color: 'gray.300' }} target="_blank">
<Collapse
color="#f26840"
fontFamily="Public Sans"
fontSize={['0.8rem', '0.9rem', '1rem', '1rem', '1.4rem']}
isOpen={show}
>
Aprender
</Collapse>
</Link>
<Link w="2rem" mt="0.5rem">
<Image
ml="0.5rem"
src="../arrow.svg"
alt="arrow"
w="1rem"
style={{
transform: 'rotate(90deg)',
}}
/>
</Link>
</Flex>
</Flex>
</Flex>
</Flex>
);
};
export default CardTech;
41 changes: 41 additions & 0 deletions components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const Button = {

baseStyle: {
fontWeight: 'bold',
textTransform: 'uppercase',
},


sizes: {
sm: {
fontSize: '12px',
padding: '16px',
},
md: {
fontSize: '16px',
padding: '24px',
},
},

variants: {
outline: {
border: '2px solid',
borderColor: 'blue.500',
},
solid: {
bg: 'black',
color: 'white',
},
coderhood: {
bg: '#f26840',
color: 'white',
},
},

defaultProps: {
size: 'md',
variant: 'outline',
},
};

export default Button;
102 changes: 56 additions & 46 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import React from 'react';
import styled from '@emotion/styled';
import { GetStaticProps } from 'next';
import NextLink from 'next/link';
import {
Link,
Flex,
Image,
SimpleGrid,
Button,
Link,
useColorMode,
Heading,
Center,
} from '@chakra-ui/core';
import { GetRoadmapsResponse } from '../api/roadmaps';
import { Text } from '../components';
import { getRoadmaps, GetRoadmapsResponse } from '../api/roadmaps';
import { Layout, Card, Text, TextureGrid, Dash } from '../components';
import CardHowDoesItWork from '../components/CardHowDoesItWork';
import DiscordConnect from '../components/DiscordConnect';

Expand All @@ -26,6 +30,7 @@ const CardRoadmap = styled.div`
border-color: #f26840;
border-width: 0.08rem;
border-radius: 0.2rem;
cursor: pointer;
`;

const Home: React.FC<Props> = ({ roadmaps }) => {
Expand Down Expand Up @@ -88,8 +93,8 @@ const Home: React.FC<Props> = ({ roadmaps }) => {
En coderhood impulzamos el aprendizaje autodidacta y colaborativo.
</Text>
<Link
width={['4rem', '6rem', '7rem', '8rem']}
href="https://discord.gg/xw2dbyv"
width={['4rem', '6rem', '7rem', '8rem']}
_hover={{ color: 'gray.300' }}
target="_blank"
>
Expand All @@ -108,8 +113,9 @@ const Home: React.FC<Props> = ({ roadmaps }) => {
</Flex>
</Flex>
</Flex>
{HowDoesItWork.map((how) => (
{HowDoesItWork.map((how, index) => (
<CardHowDoesItWork
key={index}
image={how.image}
title={how.title}
description={how.description}
Expand Down Expand Up @@ -159,48 +165,45 @@ const Home: React.FC<Props> = ({ roadmaps }) => {
columns={[1, 2, 2, 2, 2]}
spacing={['0.5rem', '2rem', '3rem', '4rem', '5rem']}
>
<Link href="/" _hover={{ color: 'gray.300' }} target="_blank">
<CardRoadmap>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Poppins"
fontWeight="500"
fontSize={['1.2rem', '1.2rem', '2rem', '2.3rem', '2.6rem']}
>
Frontend
</Text>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Public Sans"
fontSize={['0.9rem', '0.9rem', '1rem', '1rem', '1.4rem']}
mt={['0.3rem', '0.3rem', '0.4rem', '0.5rem']}
{roadmaps &&
roadmaps.map((roadmap, index) => (
<NextLink
key={index}
as={`/roadmaps/${roadmap.name}`}
href="/roadmaps/[name]"
>
Guia paso a paso para convertirte en un desarrollador
frontend moderno.
</Text>
</CardRoadmap>
</Link>
<Link href="/" _hover={{ color: 'gray.300' }} target="_blank">
<CardRoadmap>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Poppins"
fontWeight="500"
fontSize={['1.2rem', '1.2rem', '2rem', '2.3rem', '2.6rem']}
>
Backend
</Text>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Public Sans"
fontSize={['0.9rem', '0.9rem', '1rem', '1rem', '1.4rem']}
mt={['0.3rem', '0.3rem', '0.4rem', '0.5rem']}
>
Guia paso a paso para convertirte en un desarrollador
backend moderno.
</Text>
</CardRoadmap>
</Link>
<CardRoadmap>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Poppins"
fontWeight="500"
fontSize={[
'1.2rem',
'1.2rem',
'2rem',
'2.3rem',
'2.6rem',
]}
>
{roadmap.title}
</Text>
<Text
color={colorMode === 'light' ? 'gray.800' : 'gray.300'}
fontFamily="Public Sans"
fontSize={[
'0.9rem',
'0.9rem',
'1rem',
'1rem',
'1.4rem',
]}
mt={['0.3rem', '0.3rem', '0.4rem', '0.5rem']}
>
{roadmap.description}
</Text>
</CardRoadmap>
</NextLink>
))}
</SimpleGrid>
</Flex>
</Flex>
Expand All @@ -211,4 +214,11 @@ const Home: React.FC<Props> = ({ roadmaps }) => {
);
};

export const getStaticProps: GetStaticProps = async () => {
const roadmaps = await getRoadmaps();
return {
props: { roadmaps },
};
};

export default Home;
Loading