Skip to content

Commit

Permalink
updated files
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuto46490802 committed Jul 12, 2022
1 parent d080fdb commit d7a4577
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mindarc-frontend-assessment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"export": "next export"
},
"dependencies": {
"bootstrap": "^5.1.3",
Expand Down
26 changes: 26 additions & 0 deletions mindarc-frontend-assessment/pages/_document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Document, { Html, Head, Main, NextScript } from 'next/document'

class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}

render() {
return (
<Html lang='en'>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:wght@400;500;700&display=swap" rel="stylesheet" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}

export default MyDocument
12 changes: 10 additions & 2 deletions mindarc-frontend-assessment/pages/exercise2.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ const Exercise2 = () => {
<div
key={index}
className={`nav-button`}
onClick={() => setIsCardActive(`${index + 1}`)}
onClick={() => {
if (index + 1 === Number(isCardActive)) {
setIsCardActive(null)
} else {
setIsCardActive(`${index + 1}`)
}
}}
>
<h5 className="m-0">{content.title}</h5>
<div className="plus__wrapper is-mobile">
Expand Down Expand Up @@ -115,7 +121,9 @@ const Exercise2 = () => {
? contents[1].content
: isCardActive === "3"
? contents[2].content
: contents[3].content
: isCardActive === "4"
? contents[3].content
: null
: null
}
</motion.p>
Expand Down

0 comments on commit d7a4577

Please sign in to comment.