Skip to content

Commit

Permalink
feat: add sobre and made some changes in other files
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Mar 30, 2022
1 parent 6d5bb69 commit 3df5726
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/AboutSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const AboutSection = () => {
<Text>
A perifaCode é uma ONG que tem com objetivo “desgourmetizar” o mercado digital, preenchido, em sua maioria, por um estereótipo ao qual precisa ser mudado para ser mais inclusivo e com esse propósito a ONG foi criada em 2019 para capacitar, discutir e fazer ouvir a voz da periferia dentro do mercado digital.

Realizamos diversos eventos presenciais para capacitar esses jovens da periferia e contavam com vários grupos espalhados pelas redes sociais, contamos com uma comunidade ativa no Discord para discutirmos sobre programação e temas relacionados.
Realizamos diversos eventos presenciais para capacitar esses jovens da periferia e contamos com vários grupos espalhados pelas redes sociais, além de uma comunidade ativa no Discord para discutirmos sobre programação e temas relacionados.
</Text>
</Flex>
</Flex>
Expand Down
5 changes: 2 additions & 3 deletions src/components/LinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ type LinkButtonProps = {
href: string,
}

export const LinkButton = ({ children, href }: LinkButtonProps) => {
export const LinkButton = ({ children, href, ...props}: LinkButtonProps) => {
return (
<Link href={href} passHref>
<ChakraLink
target="_blank"
rel="noopener noreferrer"
{...props}
my="0.5rem"
bg="brand.primary"
width="fit-content"
Expand Down
7 changes: 4 additions & 3 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { NavItem } from "./NavItem"
export const Navbar = () => {
return (
<Flex as="nav" gap="1.5rem">
<NavItem href="/" label="Home" />
<NavItem href="/about" label="About" />
<NavItem href="/blog" label="Blog" />
<NavItem href="/" label="Página inicial" />
<NavItem href="/sobre" label="Sobre nós" />
<NavItem href="/manifesto" label="Manifesto" />
<NavItem href="/coc" label="Código de conduta" />
</Flex>
)
}
8 changes: 2 additions & 6 deletions src/pages/coc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ 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"

type CocProps = {
title: string
content: string
}

const Coc = ({ title, content }: CocProps) => {
const Coc = ({ title, content }: BasicPageProps) => {
return (
<Container maxW={1180} my="2rem">
<Heading as="h1" textTransform="uppercase" my="2rem">{title}</Heading>
Expand Down
8 changes: 3 additions & 5 deletions src/pages/manifesto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ 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"


type ManifestoProps = {
title: string
content: string
}

const Manifesto = ({ title, content }: ManifestoProps) => {
const Manifesto = ({ title, content }: BasicPageProps) => {
return (
<Container maxW={1180} my="2rem">
<Heading as="h1" textTransform="uppercase" my="2rem">{title}</Heading>
Expand Down
39 changes: 39 additions & 0 deletions src/pages/sobre.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 Sobre = ({ 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: "sobre" }) {
title,
content {
html
}
}
}
`
const { basicPage } = await graphcms.request(query)
const { title, content } = basicPage
return {
props: {
title,
content: content.html,
},
}
}


export default Sobre
2 changes: 1 addition & 1 deletion src/styles/BasicPage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
font-weight: 700;
margin: .5rem 0;
}
ul {
ul, ol {
margin-left: 2rem;
}
}
4 changes: 4 additions & 0 deletions src/types/BasicPageProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type BasicPageProps = {
title: string
content: string
}

0 comments on commit 3df5726

Please sign in to comment.