Skip to content

Commit

Permalink
feat(mentoria): add mentoria's page
Browse files Browse the repository at this point in the history
  • Loading branch information
woliveiras committed Oct 16, 2022
1 parent 29900c8 commit ffb9f39
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const Navbar = () => {
<NavItem href="/sobre" label="Sobre nós" />
<NavItem href="/manifesto" label="Manifesto" />
<NavItem href="/coc" label="Código de conduta" />
<NavItem href="/mentoria" label="Mentoria" />
</Flex>
)
}
39 changes: 39 additions & 0 deletions src/pages/mentoria.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Container, Heading } from "@chakra-ui/react"
import { gql } from "graphql-request"
import { GetStaticProps } from "next"
import { graphcms } from "../services/graphcms"
import styles from "../styles/BasicPage.module.scss"
import { BasicPageProps } from "../types/BasicPageProps"

const Manifesto = ({ title, content }: BasicPageProps) => {
return (
<Container maxW={1180} my="2rem">
<Heading as="h1" textTransform="uppercase" my="2rem">{title}</Heading>
<div className={styles.content} dangerouslySetInnerHTML={{ __html: content }} />
</Container>
)
}

export const getStaticProps: GetStaticProps = async () => {
const query = gql`
{
basicPage(where: { slug: "mentoria" }) {
title,
content {
html
}
}
}
`
const { basicPage } = await graphcms.request(query)
const { title, content } = basicPage
return {
props: {
title,
content: content.html,
},
}
}


export default Manifesto
15 changes: 15 additions & 0 deletions src/styles/BasicPage.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
.content {
a {
color: var(--chakra-colors-purple-400);
}
p, li {
line-height: 2rem;
}
table p {
word-break: break-word;
line-height: unset;
word-wrap: unset;
}
table {
border: 1px solid black;
}
th, td {
padding: 1em;
border: 1px solid black;
}
h2 {
font-size: 1.5rem;
font-weight: 700;
Expand Down

0 comments on commit ffb9f39

Please sign in to comment.