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 Document from 'next/document' | |
import { ServerStyleSheet } from 'styled-components' | |
export default class MyDocument extends Document { | |
static async getInitialProps(ctx) { | |
const sheet = new ServerStyleSheet() | |
const originalRenderPage = ctx.renderPage | |
try { | |
ctx.renderPage = () => |
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
Show hidden characters
{ | |
"presets": ["next/babel"], | |
"plugins": [["styled-components", { | |
"ssr" : true | |
}]] | |
} |
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 dateFormat = paramsDate => { | |
const month = new Array() | |
let temp = paramsDate | |
month[0] = 'January' | |
month[1] = 'February' | |
month[2] = 'March' | |
month[3] = 'April' | |
month[4] = 'May' | |
month[5] = 'June' |
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
::-webkit-scrollbar { | |
width: 5px; | |
height: 5px; | |
} | |
::-webkit-scrollbar-track { | |
background: #f1f1f1; | |
} | |
::-webkit-scrollbar-thumb { |
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 Fonts = { | |
fontFamily: 'your fonts name', | |
fontSize: { | |
12: '12px', | |
14: '14px', | |
16: '16px', | |
20: '20px', | |
24: '24px', | |
32: '32px', | |
48: '48px', |
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 videos = document.getElementsByTagName("VIDEO") | |
window.open(videos[0].src) |
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, { useEffect, useState } from 'react' | |
import axios from 'axios' | |
const index = () => { | |
const [data, setData] = useState([]) | |
useEffect(async () => { | |
const response = await axios.get('...some API path...') | |
setData(response.data) |
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 axios from 'axios' | |
const index = ({ data }) => { | |
return ( | |
<div> | |
{data.map((item, index) => { | |
return ( | |
<div key={index}>{item.name}</div> | |
) |
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 axios from 'axios' | |
const index = ({ data }) => { | |
return ( | |
<div> | |
{data.map((item, index) => { | |
return ( | |
<div key={index}>{item.name}</div> | |
) |
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 useSWR from 'swr' | |
import { fetcher } from '../utils' | |
const index = () => { | |
const { data } = useSWR('... some API Fetch ...', fetcher) | |
return ( | |
<div> |
OlderNewer