|
2 | 2 |
|
3 | 3 | import { useEffect, useState } from "react"; |
4 | 4 | import { FollowerListSchema, FollowingListSchema } from "@/lib/types"; |
5 | | -import { Github, RotateCw, Upload } from "lucide-react"; |
6 | | -import Link from "next/link"; |
7 | | -import Dropzone from "react-dropzone"; |
| 5 | +import { Github, RotateCw} from "lucide-react"; |
8 | 6 | import ExtractNamesFromJson from "@/lib/extractNamesFromJson"; |
9 | 7 | import Compare from "@/lib/comparison"; |
| 8 | +import HeroSection from "@/components/HeroSection"; |
10 | 9 | export default function Home() { |
11 | 10 | const [followers, setFollowers] = useState<string[]>([]); |
12 | 11 | const [following, setFollowing] = useState<string[]>([]); |
@@ -74,48 +73,7 @@ export default function Home() { |
74 | 73 |
|
75 | 74 | {/* TODO: Refactor this conditional rendering into separate components to improve readability. For now, leaving it in-line to focus on styling and theming. */} |
76 | 75 | {!hasProcessedDifference ? ( |
77 | | - <section className="flex flex-col container items-center gap-4"> |
78 | | - <h2 className="text-lg md:text-xl text-center"> |
79 | | - Safely see your non-followers using your official Instagram data. Your files are |
80 | | - processed right here in your browser and are never uploaded anywhere. |
81 | | - </h2> |
82 | | - <Dropzone onDrop={onDrop} accept={{ "application/json": [".json"] }}> |
83 | | - {({ getRootProps, getInputProps }) => ( |
84 | | - <div |
85 | | - {...getRootProps()} |
86 | | - className="border-2 px-2 md:px-10 py-10 md:py-30 flex flex-col gap-4 md:gap-8 items-center justify-center w-full md:w-3/5 border-dashed rounded-3xl mt-6 md:mt-12 text-lg hover:cursor-pointer" |
87 | | - > |
88 | | - <input {...getInputProps()} data-testid="file-input"></input> |
89 | | - |
90 | | - {/* Conditional rendering to show if a user has uploaded single files*/} |
91 | | - {hasProcessedFollowers && <div className="bg-slate-200 px-5 md:px-20 py-2 border-2 rounded-2xl" aria-label="Followers List Uploaded!">Followers List Uploaded!</div>} |
92 | | - |
93 | | - {hasProcessedFollowing && <div className="bg-slate-200 px-5 md:px-20 py-2 border-2 rounded-2xl">Following List Uploaded!</div>} |
94 | | - |
95 | | - <Upload size={50}></Upload> |
96 | | - <p className="text-center whitespace-normal break-words"> |
97 | | - Drag & drop your<br /> |
98 | | - <span className="bg-slate-100 text-sm font-mono mx-1 px-2 py-1 rounded break-all"> |
99 | | - followers.json |
100 | | - </span> |
101 | | - & |
102 | | - <span className="bg-slate-100 text-sm font-mono mx-1 px-2 py-1 rounded break-all"> |
103 | | - following.json |
104 | | - </span><br /> |
105 | | - files here |
106 | | - </p> |
107 | | - <span>or</span> |
108 | | - <button className="border-1 px-4 py-2 text-lg rounded-xl hover:cursor-pointer transition hover:scale-105"> |
109 | | - Select Files |
110 | | - </button> |
111 | | - </div> |
112 | | - )} |
113 | | - </Dropzone> |
114 | | - <Link href="/tutorial" className="underline"> |
115 | | - {" "} |
116 | | - Don't have your files? Here's how to get them. |
117 | | - </Link> |
118 | | - </section> |
| 76 | + <HeroSection onDrop={onDrop} hasProcessedFollowers={hasProcessedFollowers} hasProcessedFollowing={hasProcessedFollowing}></HeroSection> |
119 | 77 | ) : ( |
120 | 78 | <section className="flex flex-col items-center"> |
121 | 79 | <button |
|
0 commit comments