This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyApp({ Component, pageProps }) { | |
// Hide splash screen shen we are server side | |
useEffect(() => { | |
if (typeof window !== 'undefined') { | |
const loader = document.getElementById('globalLoader'); | |
if (loader) | |
loader.style.display = 'none'; | |
} | |
}, []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import Document, {Html, Head, Main, NextScript} from 'next/document' | |
import loader from "../src/loader"; | |
class MyDocument extends Document { | |
render() { | |
return ( | |
<Html> | |
<Head/> | |
<head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default ` | |
body{ | |
display: block; | |
} | |
#globalLoader{ | |
position: fixed; | |
z-index: 1700; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER_PORT=3000 | |
DB_PASSWORD=my-custom-password | |
DB_USERNAME=first-project-user | |
DB_DATABASE_NAME=first-project-db | |
POSTGRES_HOST=postgres | |
POSTGRES_PORT=5432 | |
PORT=3000 | |
MODE=DEV | |
#For prisma. Make sure that de pgsql service name, the db name, user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
main: | |
container_name: main | |
build: | |
context: . | |
target: development | |
volumes: | |
- .:/usr/src/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:12.13-alpine As development | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useRouter} from "next/router"; | |
//... | |
const router = useRouter(); | |
const {router_steep} = router.query | |
const steep = (isNaN(+router_steep) || +router_steep < 0) ? 0 | |
: +router_steep; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//inside the parent of carousel Dialog | |
const [dialogOpen, setDialogOpen] = useState<number>(0); | |
//inside a carousel Dialog | |
const [steep, setSteep] = useState<number>(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
const [steep, setSteep] = useState<number>(0); | |
//... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
const {name} = router.query; | |
React.useEffect(() => { | |
router.replace(`/products/${name}`); | |
}) | |
//... |
NewerOlder