Skip to content

Commit 5a02c17

Browse files
committed
Addes double quotes, semicolons, cleaned up App component and modified responsiveness in css.
1 parent c68cbad commit 5a02c17

File tree

4 files changed

+38
-44
lines changed

4 files changed

+38
-44
lines changed

src/App.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,7 @@ function App() {
8585
</div>
8686

8787
{/* FlashCards Section */}
88-
<div
89-
style={{
90-
padding: '40px 20px',
91-
borderTop: '1px solid var(--border-color)',
92-
background: 'var(--background-color)',
93-
}}
94-
>
95-
<FlashCards />
96-
</div>
88+
<FlashCards />
9789
</>
9890
)
9991
}

src/components/kelixirr/Details.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Author from "../../Author";
66
export default function Details() {
77
const [count, setCount] = useState(0);
88

9-
const handleCount = (type) => {
10-
setCount((prev) => {
9+
const handleCount = type => {
10+
setCount(prev => {
1111
if (type === "increase" && prev < 20) {
1212
return prev + 1;
1313
} else if (type === "decrease" && prev > 0) {
@@ -30,8 +30,8 @@ export default function Details() {
3030
<p>
3131
Welcome to the <strong>ReactDevs</strong> project! This project allows
3232
contributors to add React components that are simple yet creative.
33-
It&apos;s a great way to practice, collaborate, and learn React in an open source environment. Here is an
34-
example:
33+
It&apos;s a great way to practice, collaborate, and learn React in an
34+
open source environment. Here is an example:
3535
</p>
3636

3737
<div className={styles.cartContainer}>
@@ -63,17 +63,17 @@ export default function Details() {
6363
Once you have created your component, add the Author component as
6464
shown above to get the credit. Here is the example code:
6565
</p>
66-
<pre className={styles.codeBlock}>
67-
<code>
68-
{`import { useState } from "react";
66+
<pre className={styles.codeBlock}>
67+
<code>
68+
{`import { useState } from "react";
6969
import styles from "../your_username/Cart.module.css";
7070
import { FaCartShopping } from "react-icons/fa6";
7171
import { FiMinus, FiPlus } from "react-icons/fi";
7272
import Author from "../../Author";
7373
7474
export default function Cart() {
7575
const [count, setCount] = useState(0);
76-
76+
7777
const handleCount = (type) => {
7878
setCount((prev) => {
7979
if (type === "increase" && prev < 20) {
@@ -88,7 +88,7 @@ export default function Cart() {
8888
return (
8989
<>
9090
<div className={styles.cartContainer}>
91-
<button
91+
<button
9292
className={styles.cartButton}
9393
onClick={() => handleCount("decrease")}
9494
disabled={count === 0}
@@ -103,7 +103,7 @@ export default function Cart() {
103103
? \`\${count} - items in your cart\`
104104
: \`\${count} - Your cart is empty\`}
105105
</p>
106-
<button
106+
<button
107107
className={styles.cartButton}
108108
onClick={() => handleCount("increase")}
109109
disabled={count === 20}
@@ -115,8 +115,8 @@ export default function Cart() {
115115
</>
116116
);
117117
}`}
118-
</code>
119-
</pre>
118+
</code>
119+
</pre>
120120
<p style={{ textAlign: "center", marginTop: "2.4rem" }}>
121121
Good Luck! We can&apos; wait to see you being part of this project!{" "}
122122
<a
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
import styles from '../mektefaie/FlashCards.module.css'
2-
import Author from '../../Author'
3-
import { useState } from 'react'
1+
import styles from "../mektefaie/FlashCards.module.css";
2+
import Author from "../../Author";
3+
import { useState } from "react";
44

55
const cards = [
66
{
77
id: 1,
8-
question: 'The creator of ReactDevs project?',
9-
answer: 'Amritesh Kumar',
8+
question: "The creator of ReactDevs project?",
9+
answer: "Amritesh Kumar",
1010
},
1111
{
1212
id: 2,
13-
question: 'When was ReactDevs project created?',
14-
answer: '2024',
13+
question: "When was ReactDevs project created?",
14+
answer: "2024",
1515
},
1616
{
1717
id: 3,
18-
question: 'The first contributor to ReactDevs project?',
19-
answer: 'Victor Ezeanyika',
18+
question: "The first contributor to ReactDevs project?",
19+
answer: "Victor Ezeanyika",
2020
},
2121
{
2222
id: 4,
23-
question: 'Best React course?',
23+
question: "Best React course?",
2424
answer: "Jonas Schmedtmann's Ultimate React course on Udemy",
2525
},
2626
{
2727
id: 5,
28-
question: 'Best Frontend bootcamp?',
29-
answer: 'Scrimba.com',
28+
question: "Best Frontend bootcamp?",
29+
answer: "Scrimba.com",
3030
},
3131
{
3232
id: 6,
33-
question: 'Best Backend bootcamp?',
34-
answer: 'Boot.dev',
33+
question: "Best Backend bootcamp?",
34+
answer: "Boot.dev",
3535
},
36-
]
36+
];
3737

3838
export default function FlashCards() {
39-
const [selectedId, setSelectedID] = useState(null)
39+
const [selectedId, setSelectedID] = useState(null);
4040

4141
function handleClick(id) {
42-
setSelectedID(id === selectedId ? null : id)
42+
setSelectedID(id === selectedId ? null : id);
4343
}
4444

4545
return (
@@ -52,17 +52,17 @@ export default function FlashCards() {
5252
{cards.map(question => (
5353
<div
5454
key={question.id}
55-
className={question.id === selectedId ? styles.selected : ''}
55+
className={question.id === selectedId ? styles.selected : ""}
5656
onClick={() => handleClick(question.id)}
5757
>
5858
{question.id === selectedId ? question.answer : question.question}
5959
</div>
6060
))}
6161
</div>
6262
<Author
63-
name='Mahmoud Ektefaie'
64-
githubLink='https://github.com/mektefaie'
63+
name="Mahmoud Ektefaie"
64+
githubLink="https://github.com/mektefaie"
6565
/>
6666
</section>
67-
)
67+
);
6868
}

src/components/mektefaie/FlashCards.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
font-weight: var(--font-weight-regular);
3737
}
3838

39-
@media (max-width: 46rem) {
39+
/* medium breakpoint */
40+
@media (max-width: 767px) {
4041
.flashcards {
4142
grid-template-columns: 1fr 1fr;
4243
}
4344
}
4445

45-
@media (max-width: 38rem) {
46+
/* small breakpoint */
47+
@media (max-width: 639px) {
4648
.flashcards {
4749
grid-template-columns: 1fr;
4850
}

0 commit comments

Comments
 (0)