Skip to content

Commit 620e163

Browse files
committed
Update home page
1 parent 9837dc2 commit 620e163

File tree

1 file changed

+48
-33
lines changed

1 file changed

+48
-33
lines changed

src/views/Home.tsx

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,58 @@ const Home = () => {
3030
}, []);
3131

3232
return (
33-
<div className="flex flex-col justify-center items-center h-screen px-4 text-center dark:bg-custom-black">
34-
<h1 className="text-3xl font-bold font-mono tracking-wide text-gray-500 dark:text-white">RedditLite</h1>
35-
<h4 className="tracking-wide text-gray-500 dark:text-white">Lightweight Reddit Browsing</h4>
36-
<SearchInput />
37-
<p className="text-sm tracking-wide text-gray-500 dark:text-white mt-4">
38-
Browse the most popular posts from{" "}
39-
<a href="/r/popular" className="font-semibold text-blue-500 dark:text-blue-300">
40-
/r/popular
41-
</a>
42-
</p>
33+
<div className="flex flex-col justify-center items-center min-h-screen px-4 text-center dark:bg-custom-black">
34+
<div className="space-y-2 mb-4">
35+
<h1 className="text-3xl font-bold font-mono tracking-wide text-gray-600 dark:text-white">
36+
RedditLite
37+
</h1>
38+
<h4 className="tracking-wide text-gray-500 dark:text-white text-md">
39+
Lightweight Reddit Browsing
40+
</h4>
41+
</div>
42+
43+
<div className="w-full max-w-sm">
44+
<SearchInput />
45+
</div>
4346

44-
<div className="mt-6 w-full px-2 max-w-sm text-sm">
45-
{starredSubreddits.length > 0 && (
46-
<>
47-
<p className="font-semibold text-md text-gray-600 dark:text-gray-200 mb-2">Your Starred Subreddits</p>
48-
<div className="grid grid-cols-1 gap-2">
49-
{starredSubreddits.map(({ name, community_icon, icon_img }) => (
50-
<div
51-
key={name}
52-
className="bg-gray-200 dark:bg-gray-700 p-2 rounded shadow text-gray-600 dark:text-gray-200 cursor-pointer text-sm flex items-center justify-between"
53-
>
54-
<div className="flex items-center">
47+
<div className="mt-1 flex gap-3">
48+
<div className="p-2 text-sm text-gray-600 dark:text-gray-300">
49+
Browse the most popular posts from <a
50+
href="/r/popular"
51+
className="text-blue-500 dark:text-blue-300 hover:underline font-medium"
52+
>
53+
/r/popular
54+
</a>
55+
</div>
56+
</div>
57+
{starredSubreddits.length > 0 && (
58+
<div className="mt-4 w-full max-w-sm">
59+
<h2 className="font-semibold text-md text-gray-600 dark:text-gray-200 mb-4">
60+
Your Starred Communities
61+
</h2>
62+
<div className="grid grid-cols-1 gap-3">
63+
{starredSubreddits.map(({ name, community_icon, icon_img }) => (
64+
<a
65+
key={name}
66+
href={`/r/${name}`}
67+
className="group flex items-center p-1.5 bg-white dark:bg-gray-800 rounded-md border border-gray-200 dark:border-gray-700 hover:border-blue-500 dark:hover:border-blue-500 transition-all hover:shadow-sm"
68+
>
69+
<div className="flex items-center gap-1.5 w-full">
70+
<div className="transform group-hover:scale-105 transition-transform">
5571
<SubredditIcon community_icon={community_icon} icon_img={icon_img} />
56-
<p className="font-semibold">{name}</p>
5772
</div>
58-
<a
59-
href={`/r/${name}`}
60-
className="text-blue-500 dark:text-blue-400 font-semibold hover:underline text-xs"
61-
>
62-
Visit
63-
</a>
73+
<div className="flex justify-between items-center w-full">
74+
<p className="font-semibold text-sm text-gray-700 dark:text-gray-200">r/{name}</p>
75+
<p className="text-xs text-gray-500 dark:text-gray-400 group-hover:text-blue-500 dark:group-hover:text-blue-300">
76+
Visit Community →
77+
</p>
78+
</div>
6479
</div>
65-
))}
66-
</div>
67-
</>
68-
)}
69-
</div>
80+
</a>
81+
))}
82+
</div>
83+
</div>
84+
)}
7085
</div>
7186
);
7287
};

0 commit comments

Comments
 (0)