-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup next and test index page #5
Conversation
README.md
Outdated
@@ -1,2 +1,34 @@ | |||
# sitenovo | |||
Site do projeto DadosJusBR | |||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fico feliz demais em ver esse começo do readme em inglês, mas gostaria que mudasse para português. Achamos que vai diminuir a barreira para devs brasileiros é importante pra colaboração.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eita professor, é que esse readme é gerado pelo próprio next, mas eu vou altera-lo
README.md
Outdated
@@ -1,2 +1,34 @@ | |||
# sitenovo | |||
Site do projeto DadosJusBR | |||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O começo da página pode falar um pouco do projeto. Pode ter um parágrafo extraído do repo site ou do próprio site atual: dadusjusbr.org
README.md
Outdated
|
||
## Getting Started | ||
|
||
First, run the development server: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listar dependências e explicar que elas serão instaladas automaticamente no gitpod.
README.md
Outdated
|
||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não teremos API na primeira versão
README.md
Outdated
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remover essa seção.
public/vercel.svg
Outdated
@@ -0,0 +1,4 @@ | |||
<svg width="283" height="64" viewBox="0 0 283 64" fill="none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pra que queremos esse arquivo?
pages/index.tsx
Outdated
@@ -0,0 +1,9 @@ | |||
import Head from 'next/head' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Você não está fazendo nada com o header. Pode remover esse import e colocar depois
pages/index.tsx
Outdated
@@ -0,0 +1,9 @@ | |||
import Head from 'next/head' | |||
|
|||
export default function Home() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default function Home() { | |
export default function Index() { |
Vai ficar mais fácil de entender se a gente tiver a função pública com o mesmo nome do arquivo, né?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concordo
pages/_app.tsx
Outdated
@@ -0,0 +1,6 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pode colocar um comentário explicando por que esse arquivo está aqui. Inclusive, colocar essa URL https://nextjs.org/docs/advanced-features/custom-app
Imagino que você já sabia que vai usar aspectos mais avançados, por isso já está colocando ele. Caso não tenha nada em mente, pode removê-lo.
README.md
Outdated
First, run the development server: | ||
|
||
```bash | ||
npm run dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se entendi bem, você está usando yarn e está comitando o arquivo yarn.lock
e ele serve para garantir versões entre implantações (fonte). Dito isso, não devemos usar somente yarn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sim e não, pq o yarn ele vai estar funcionando de forma integrada com o npm, e normalmente nos ambientes de produção não é instalado o yarn, apenas o npm, mas claro, eu posso deixar tudo bonitinho pra funcionar só com o yarn se form preferível
next-env.d.ts
Outdated
@@ -0,0 +1,2 @@ | |||
/// <reference types="next" /> | |||
/// <reference types="next/types/global" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pode adicionar uma linha comentada com esse link: https://nextjs.org/docs/basic-features/typescript
Mostrando onde podemos mais informações sobre esse arquivo. Ele não é óbvio.
src/components/Nav/index.tsx
Outdated
@@ -0,0 +1,30 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisamos mesmo do subdiretório Nav? Caso contrário, vamos prosseguir colocando a maior parte da coisas na raiz e só criando diretórios quando necessário. Não há problema em cirar subdiretórios, porém acho que devemos ir criando quando for necessário.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu acredito que sim, pois ele é uma partial (componente reutilizável) e vou estar usando ele em mais de uma page, e como eu uso esse padrão modular de pastas pra conseguir deixar os partials mais reutilizáveis eu acho que é um padrão interessante, aí tipo, importante citar tbm que o nav é reutilizado em N lugares na aplicação, então não torna-lo um partial seria uma reutilização desnecessária de código
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duas perguntas diretas. Caso prefira, podemos conversar via fone ou VC.
- Os diretórios são necessários para criação de componnte?
- Quais as vantagens de usar subdiretórios em Next.js?
Outro ponto interessante:
- Quando comparo com esse projeto template para Next.js, noto que não precisa do diretório src.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se o senhor quiser podemos marcar uma pequena reunião para eu tirar essas dúvidas mais estruturais, se o senhor tiver tempo é claro
src/styles/global.ts
Outdated
@@ -0,0 +1,18 @@ | |||
import { createGlobalStyle } from 'styled-components'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chamar o arquivo de global_style
ou mover para dentro de syle.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feito!
src/components/Nav/index.tsx
Outdated
@@ -0,0 +1,30 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duas perguntas diretas. Caso prefira, podemos conversar via fone ou VC.
- Os diretórios são necessários para criação de componnte?
- Quais as vantagens de usar subdiretórios em Next.js?
Outro ponto interessante:
- Quando comparo com esse projeto template para Next.js, noto que não precisa do diretório src.
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
Co-authored-by: Daniel Fireman <[email protected]>
…adosjusbr/site-novo into setup-next-and-test-index-page
Co-authored-by: Daniel Fireman <[email protected]>
@@ -0,0 +1,81 @@ | |||
import React from 'react'; | |||
import Link from 'next/link'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mover pasta components para o diretório raiz
@@ -0,0 +1,18 @@ | |||
import GlobalStyle from '../styles/global_style'; | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mover pasta pages para diretório raiz
@@ -0,0 +1,18 @@ | |||
import { createGlobalStyle } from 'styled-components'; | |||
|
|||
export default createGlobalStyle` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mover global_style.tsx para /pages
the first step to finish the #1, here the nextjs is setup and is served a page with metadata