Skip to content

Commit 9b2037b

Browse files
committed
📦 NEW: popup box & added bio
1 parent 51b4fc4 commit 9b2037b

File tree

6 files changed

+68
-10
lines changed

6 files changed

+68
-10
lines changed

components/Card.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
22
import Link from 'next/link';
33
import styles from '../styles/Card.module.css';
44

5-
const Card = ({ url, name, pod, github, linkedin, more }) => {
5+
const Card = ({ url, name, pod, github, linkedin, bio, openPopupboxForPod }) => {
66
const [podClass, setPodClass] = useState(styles.card);
77
useEffect(() => {
88
if (pod === true) {
@@ -44,11 +44,11 @@ const Card = ({ url, name, pod, github, linkedin, more }) => {
4444
)}
4545
</div>
4646
<div className={styles.read_more_btn}>
47-
<Link href={more} passHref={true}>
48-
<a>
49-
<button>Read More</button>
50-
</a>
51-
</Link>
47+
{/* <Link href={more} passHref={true}> */}
48+
{/* <a> */}
49+
<button onClick={() => openPopupboxForPod(bio)}>Read More</button>
50+
{/* </a> */}
51+
{/* </Link> */}
5252
</div>
5353
</div>
5454
);

components/Pod.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import data from '../data/podMembers';
33
import Card from './Card';
44
import styles from '../styles/Pod.module.css';
55

6-
const Pod = () => {
6+
const Pod = ({ openPopupboxForPod }) => {
77
const [podMembers] = useState(data);
88

99
return (
@@ -16,9 +16,10 @@ const Pod = () => {
1616
name={member.name}
1717
github={member.github}
1818
linkedin={member.linkedin}
19-
more={member.more}
19+
bio={member.bio}
2020
pod={true}
2121
key={Math.floor(Math.random() * 10000)}
22+
openPopupboxForPod={openPopupboxForPod}
2223
/>
2324
))}
2425
</div>

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"dependencies": {
1111
"next": "9.5.4",
1212
"react": "16.13.1",
13-
"react-dom": "16.13.1"
13+
"react-dom": "16.13.1",
14+
"react-popupbox": "^2.0.8"
1415
}
1516
}

pages/index.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,36 @@ import Coding_Crow from '../components/Coding_Crow';
33
import Pod_Leader from '../components/Pod_Leader';
44
import Pod from '../components/Pod';
55
import Footer from '../components/Footer';
6+
import { PopupboxManager, PopupboxContainer } from 'react-popupbox';
7+
import 'react-popupbox/dist/react-popupbox.css';
8+
9+
// popup Box Body
10+
const openPopupboxForPod = bio => {
11+
const content = (
12+
<div className='popup' align='center'>
13+
<h3 className='popup-title'>Who am i? </h3>
14+
<p>{bio}</p>
15+
</div>
16+
);
17+
PopupboxManager.open({ content });
18+
};
19+
20+
// popup box configs
21+
const popupboxConfig = {
22+
fadeIn: true,
23+
fadeInSpeed: 400,
24+
overlayOpacity: 0.5,
25+
};
626

727
export default function Home() {
828
return (
929
<>
1030
<SEO />
1131
<Coding_Crow />
1232
<Pod_Leader />
13-
<Pod />
33+
<Pod openPopupboxForPod={openPopupboxForPod} />
1434
<Footer />
35+
<PopupboxContainer {...popupboxConfig} />
1536
</>
1637
);
1738
}

styles/globals.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,24 @@ a {
1414
* {
1515
box-sizing: border-box;
1616
}
17+
18+
.popupbox-wrapper {
19+
width: 50%;
20+
background-color: #2d2b55 !important;
21+
}
22+
23+
.popupbox-content {
24+
padding: 0 !important;
25+
}
26+
27+
.popupbox-content h3 {
28+
text-transform: uppercase !important;
29+
color: #ffffff !important;
30+
}
31+
32+
.popupbox-content p {
33+
background-color: #ffffff;
34+
margin: 0;
35+
padding: 40px 40px;
36+
font-family: 'Lora', serif;
37+
}

0 commit comments

Comments
 (0)