-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- accessibility - loading states for improved streaming performance - static pages for deal pages
- Loading branch information
1 parent
f5c5da0
commit 8cc3e7f
Showing
23 changed files
with
166 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import LoadingPreview from '@/components/deals/loading/LoadingPreview' | ||
import React from 'react' | ||
|
||
export default function Loading() { | ||
return <LoadingPreview /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
|
||
export default function IconButton({ | ||
handleClick, | ||
children, | ||
}: { | ||
handleClick: () => void | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<button | ||
type="button" | ||
className="text-brand bg-surface-1 hover:bg-surface-2 flex h-10 w-10 items-center justify-center rounded-full text-xs transition-transform hover:-translate-y-0.5" | ||
onClick={handleClick} | ||
> | ||
{children} | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { getApprovedDeals } from '@/lib/queries' | ||
import React from 'react' | ||
import DealsList from './DealsList' | ||
|
||
export default async function ApprovedDeals() { | ||
const deals = await getApprovedDeals(20) | ||
|
||
return <DealsList deals={deals} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { getApprovedDealsByCategory } from '@/lib/queries' | ||
import React from 'react' | ||
import DealsList from './DealsList' | ||
import { Category } from '@/types/Types' | ||
|
||
export default async function ApprovedDealsByCategory({ | ||
category, | ||
}: { | ||
category: Category | ||
}) { | ||
const deals = await getApprovedDealsByCategory(category) | ||
|
||
return <DealsList deals={deals} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
src/components/DealGradientPlaceholder.tsx → ...ponents/deals/DealGradientPlaceholder.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import DealsList from './DealsList' | ||
import { getApprovedFeaturedDeals } from '@/lib/queries' | ||
|
||
export default async function FeaturedDeals() { | ||
const deals = await getApprovedFeaturedDeals() | ||
return <DealsList deals={deals} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function LoadingDealImage() { | ||
return ( | ||
<div className=" flex aspect-video w-full animate-pulse items-center justify-center rounded-xl border-4 border-slate-500 bg-gray-100"></div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import LoadingDealImage from './LoadingDealImage' | ||
|
||
export default function LoadingDealsList({ count }: { count: number }) { | ||
const arr = Array.from(Array(count).keys()) | ||
|
||
return ( | ||
<div className="mx-auto py-10"> | ||
<div className="mx-auto grid grid-cols-1 justify-items-center gap-x-4 gap-y-12 sm:grid-cols-2 lg:gap-x-12 xl:grid-cols-3"> | ||
<> | ||
{arr.map((num) => ( | ||
<div key={num} className="w-full"> | ||
<LoadingDealImage /> | ||
<div className="mt-1 h-[1.75rem]"></div> | ||
</div> | ||
))} | ||
</> | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.