mirror of
https://github.com/ershisan99/podcaster.git
synced 2025-12-18 12:33:48 +00:00
feat: add home page styles
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en" class="bg-slate-50">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|||||||
@@ -14,10 +14,26 @@ export function PodcastPreviewCard({
|
|||||||
detailUrl,
|
detailUrl,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
return (
|
return (
|
||||||
<Link to={detailUrl}>
|
<Link to={detailUrl} className={"w-full"}>
|
||||||
<img src={imageUrl} alt={title} />
|
<div className={"relative mt-12 p-3 pt-12 shadow-md"}>
|
||||||
<h3>{title}</h3>
|
<img
|
||||||
<h4>{author}</h4>
|
src={imageUrl}
|
||||||
|
alt={title}
|
||||||
|
className={
|
||||||
|
"absolute -top-12 left-2/4 h-24 w-24 -translate-x-1/2 rounded-full object-cover"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<h3
|
||||||
|
className={
|
||||||
|
"text-md mt-2 text-center font-semibold uppercase tracking-tight"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</h3>
|
||||||
|
<h4 className={"mt-2 text-center text-sm text-slate-500"}>
|
||||||
|
Author: {author}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { PodcastPreviewCard } from "../components/podcast-preview-card";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { PodcastPreviewCard } from "../components/podcast-preview-card";
|
||||||
import { useTopPodcastsQuery } from "../services/podcasts/podcast.hooks";
|
import { useTopPodcastsQuery } from "../services/podcasts/podcast.hooks";
|
||||||
|
|
||||||
export function Home() {
|
export function Home() {
|
||||||
@@ -18,14 +19,24 @@ export function Home() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main>
|
<div>
|
||||||
|
<div className={"mb-6 flex items-center justify-end gap-3"}>
|
||||||
|
<span
|
||||||
|
className={
|
||||||
|
"flex items-center rounded-xl bg-sky-800 px-2 py-1.5 font-bold leading-none text-white"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{filteredData?.length}
|
||||||
|
</span>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={search}
|
value={search}
|
||||||
onChange={(e) => setSearch(e.target.value)}
|
onChange={(e) => setSearch(e.target.value)}
|
||||||
placeholder="Search..."
|
placeholder="Filter podcasts..."
|
||||||
|
className={"w-1/3 rounded-md border border-gray-300 p-2"}
|
||||||
/>
|
/>
|
||||||
<div className={"grid grid-cols-4"}>
|
</div>
|
||||||
|
<div className={"grid grid-cols-4 gap-x-6 gap-y-14"}>
|
||||||
{filteredData?.map((podcast) => (
|
{filteredData?.map((podcast) => (
|
||||||
<PodcastPreviewCard
|
<PodcastPreviewCard
|
||||||
detailUrl={`/podcast/${podcast.id}`}
|
detailUrl={`/podcast/${podcast.id}`}
|
||||||
@@ -36,6 +47,6 @@ export function Home() {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user