Skip to content

Commit 8f88e75

Browse files
committed
moved options arrary into utils
1 parent 8d2deb4 commit 8f88e75

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

client/src/components/Home.jsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import WorthAlert from "./Worth/WorthAlert";
1010
import Skeleton from "./Skeletons/Skeleton";
1111
import HomeSkeleton from "./Skeletons/HomeSkeleton";
1212
import PromotedCard from "./PromotedCard";
13+
import { options } from "../utils/index"
1314

1415
export default function Home() {
1516
const [showStats, setShowStats] = useState(false);
@@ -84,28 +85,7 @@ export default function Home() {
8485

8586
const [selectedValue, setSelectedValue] = useState('Only Value');
8687

87-
const options = [
88-
{
89-
heading: "Could you drop a star on the GitHub repo? It helps a lot!👋",
90-
imgSrc: "/promoted1.png",
91-
},
92-
{
93-
heading: "Drop a star on our GitHub repo to show your support!🌟",
94-
imgSrc: "/promoted1.png",
95-
},
96-
{
97-
heading: "Can you drop a star on the GitHub repo? It helps a lot!👋 ",
98-
imgSrc: "/promoted2.webp",
99-
},
100-
{
101-
heading: "Could you drop a star on the GitHub repo? It helps a lot!👋 ",
102-
imgSrc: "/promoted3.png",
103-
},
104-
{
105-
heading: "Can you please share this project with your friends and family?✨ ",
106-
imgSrc: "/promoted3.png",
107-
}
108-
];
88+
10989
const [random, setRandom] = useState(Math.floor(Math.random() * options.length));
11090

11191

client/src/utils/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export const options = [
2+
{
3+
heading: "Could you drop a star on the GitHub repo? It helps a lot!👋",
4+
imgSrc: "/promoted1.png",
5+
},
6+
{
7+
heading: "Drop a star on our GitHub repo to show your support!🌟",
8+
imgSrc: "/promoted1.png",
9+
},
10+
{
11+
heading: "Can you drop a star on the GitHub repo? It helps a lot!👋 ",
12+
imgSrc: "/promoted2.webp",
13+
},
14+
{
15+
heading: "Could you drop a star on the GitHub repo? It helps a lot!👋 ",
16+
imgSrc: "/promoted3.png",
17+
},
18+
{
19+
heading: "Can you please share this project with your friends and family?✨ ",
20+
imgSrc: "/promoted3.png",
21+
}
22+
];

0 commit comments

Comments
 (0)