Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update page.tsx #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions app/(root)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,40 @@ export default async function Home({
}) {
const query = (await searchParams).query;
const params = { search: query || null };

const session = await auth();

console.log(session?.id);

const { data: posts } = await sanityFetch({ query: STARTUPS_QUERY, params });

return (
<>
<section className="pink_container">
<h1 className="heading">
{/* Hero Section */}
<section className="flex flex-col items-center justify-center text-center bg-white py-16 px-6 sm:px-10 md:px-16">
<h1 className="text-5xl sm:text-6xl md:text-7xl font-extrabold bg-clip-text text-transparent bg-gradient from-pink-500 via-purple-500 to-blue-500 leading-tight tracking-tight mb-4 ">
Pitch Your Startup, <br />
Connect With Entrepreneurs
</h1>

<p className="sub-heading !max-w-3xl">
Submit Ideas, Vote on Pitches, and Get Noticed in Virtual
Competitions.
<p className="text-lg sm:text-xl md:text-2xl text-gray-600 max-w-2xl leading-relaxed mb-8 animate-slideUp">
Submit Ideas, Vote on Pitches, and Get Noticed in Virtual Competitions.
</p>

<SearchForm query={query} />
<SearchForm query={query} className="w-full max-w-lg" />
</section>

<section className="section_container">
<p className="text-30-semibold">
{query ? `Search results for "${query}"` : "All Startups"}
{/* Startups Section */}
<section className="bg-gray-50 py-20 px-6 sm:px-10 md:px-16">
<p className="text-2xl sm:text-3xl font-semibold text-gray-800 mb-10">
{query ? `Search results for "${query}"` : "Explore All Startups"}
</p>

<ul className="mt-7 card_grid">
<ul className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 ">
{posts?.length > 0 ? (
posts.map((post: StartupTypeCard) => (
<StartupCard key={post?._id} post={post} />
))
) : (
<p className="no-results">No startups found</p>
<p className="text-center text-gray-600 col-span-full text-xl">
No startups found.
</p>
)}
</ul>
</section>
Expand Down