Skip to content

Instantly share code, notes, and snippets.

View igorasilveira's full-sized avatar

Igor Silveira igorasilveira

View GitHub Profile
@igorasilveira
igorasilveira / a-doggo.tsx
Created February 19, 2022 09:33
Doggo .tsx Page
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'
const Doggo: NextPage = () => {
return (
<div>
<Head>
<title>A Doggo</title>
</Head>
<main>
@igorasilveira
igorasilveira / next.config.js
Created February 19, 2022 09:34
Nextjs config
const nextConfig = {
reactStrictMode: true,
images: {
domains: [
"loremflickr.com" // <- added this
]
}
}
module.exports = nextConfig
@igorasilveira
igorasilveira / index.tsx
Created February 19, 2022 09:36
Index page
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'
import Link from 'next/link'
import styles from '../styles/Home.module.css'
const Home: NextPage = () => {
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
@igorasilveira
igorasilveira / a-doggo.tsx
Created February 19, 2022 09:36
Doggo page
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'
import Link from 'next/link'
const Doggo: NextPage = () => {
return (
<div>
<Head>
<title>A Doggo</title>
</Head>
@igorasilveira
igorasilveira / protected.js
Created February 19, 2022 09:38
Protected page
import Head from "next/head";
import Navbar from "../components/Navbar";
import styles from "../styles/Home.module.css";
export default function Protected() {
return (
<div className={styles.container}>
<Head>
<title>Protected page</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
@igorasilveira
igorasilveira / Navbar.js
Created February 19, 2022 09:38
Navbar component
import React from "react";
import styles from "../styles/Navbar.module.css";
export default function Navbar() {
return (
<nav className={styles.nav}>
<a href="/">Navbar</a>
<div>
<button>
<a href="/login">Login</a>
</button>
.nav {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 24px;
font-size: 1.4rem;
font-weight: bold;
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}
@igorasilveira
igorasilveira / .env
Created February 19, 2022 09:41
Env Auth0
AUTH0_SECRET=<YOUR_AUTH0_SECRET>
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=<YOUR_AUTH0_DOMAIN>
AUTH0_CLIENT_ID=<YOUR_AUTH0_CLIENT_ID>
AUTH0_CLIENT_SECRET=<YOUR_AUTH0_CLIENT_SECRET>
@igorasilveira
igorasilveira / [...auth0].js
Created February 19, 2022 09:41
Auth0 Api page
import { handleAuth } from '@auth0/nextjs-auth0';
export default handleAuth();
@igorasilveira
igorasilveira / _app.js
Last active February 19, 2022 09:44
App JS
import '../styles/globals.css'
import { UserProvider } from '@auth0/nextjs-auth0';
export default function App({ Component, pageProps }) {
return (
<UserProvider>
<Component {...pageProps} />
</UserProvider>
);
}