This file contains 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 "../styles/globals.css"; | |
import type { AppProps } from "next/app"; | |
import Script from "next/script"; | |
function MyApp({ Component, pageProps }: AppProps) { | |
return ( | |
<> | |
<Script | |
src="//dapi.kakao.com/v2/maps/sdk.js?appkey=6887e18eea343d9ecb3cc5e964acd13b&libraries=services,clusterer&autoload=false" | |
strategy="beforeInteractive" |
This file contains 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 "../styles/globals.css"; | |
import type { AppProps } from "next/app"; | |
import Script from "next/script"; | |
function MyApp({ Component, pageProps }: AppProps) { | |
return ( | |
<> | |
<Script | |
src="//dapi.kakao.com/v2/maps/sdk.js?appkey=6887e18eea343d9ecb3cc5e964acd13b&libraries=services,clusterer&autoload=false" | |
strategy="beforeInteractive" |
This file contains 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
// CASE #1: no abstraction | |
const displayNameOnly = 'Jay Min' | |
const nameWithAge = 'Jay Min, 33' | |
const nameAndFavouriteMovie = 'Jay Min, favourite movie: Baby Driver' | |
const nameAndFavouriteBand = 'Jay Min, favourite band: Black Sabbath' |
This file contains 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
// SORT BY DATE (TOGGLE) | |
const sortByDate = () => { | |
if (new Date(inventory[0].expiration_date).valueOf() < new Date(inventory[inventory.length -1 ].expiration_date).valueOf()) { | |
const sortedInventory = inventory.slice(0).sort((a: Inventory, b:Inventory) => {return new Date(b.expiration_date).valueOf() - new Date(a.expiration_date).valueOf()}) | |
setInventory(sortedInventory) | |
} else { | |
const sortedInventory = inventory.slice(0).sort((a: Inventory, b:Inventory) => {return new Date(a.expiration_date).valueOf() - new Date(b.expiration_date).valueOf()}) | |
setInventory(sortedInventory) | |
} | |
} |