-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from odeta939/newWineCards
Added WineTastingCard
- Loading branch information
Showing
17 changed files
with
84 additions
and
21 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
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 |
---|---|---|
@@ -1,16 +1,27 @@ | ||
import WineCarousel from '@/components/WineCarousel'; | ||
import WineButton from '@/components/WineButton'; | ||
import { getWines } from '@/sanity/sanity-utils/wine-utils'; | ||
import { getThisMonthsWines, getWines } from '@/sanity/sanity-utils/wine-utils'; | ||
import WineTastingCard from '@/components/WineTastingCard'; | ||
import { getCurrentMonthAsRange } from '@/lib/utils/helperFunctions'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export default async function Home() { | ||
const wines = await getWines(); | ||
const date = getCurrentMonthAsRange(); | ||
|
||
const thisMonthsWines: Wine[] = await getThisMonthsWines(date.from, date.to); | ||
|
||
return ( | ||
<main className='min-h-screen flex flex-col items-stretch'> | ||
<WineButton /> | ||
<WineCarousel wines={wines} /> | ||
<main className='flex flex-grow justify-center items-center'> | ||
<div className='flex flex-row flex-grow justify-around'> | ||
{thisMonthsWines.map((wine, index) => { | ||
return ( | ||
<div className='' key={index}> | ||
<WineTastingCard wine={wine} /> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</main> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
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,2 @@ | ||
import WineListCard from './WineListCard'; | ||
export default WineListCard; |
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,34 @@ | ||
import Image from 'next/image'; | ||
|
||
interface WineTastingProps { | ||
wine: Wine; | ||
} | ||
export default function WineTastingCard({ | ||
wine: { name, imageUrl, tag, price, taste, smell, body }, | ||
}: WineTastingProps) { | ||
return ( | ||
<div className='w-64 h-[390px] xl:w-80 xl:h-[460px] p-4 px-5 bg-neutral-50 rounded-3xl shadow-[4px_4px_4px_rgba(0,0,0,0.45)]'> | ||
<div className='w-28 h-48 xl:w-32 xl:h-56 mx-auto relative'> | ||
<Image | ||
className='rounded-3xl' | ||
alt='Image of a wine bottle' | ||
src={`${imageUrl}`} | ||
layout='fill' | ||
objectFit='cover' | ||
/> | ||
</div> | ||
<div className='bg-neutral-50 w-16 h-7 rounded-3xl text-center ring-black ring-1 text-black text-sm mt-4 xl:mt-6 py-1'> | ||
{tag} | ||
</div> | ||
<div className='text-black mt-3'> | ||
<p className='text-xl xl:text-2xl'>{name}</p> | ||
<p className='text-wine-red text-base xl:text-lg'>{price} NOK</p> | ||
<div className='grid grid-cols-2 gap-x-10 gap-[2px] xl:text-base text-sm'> | ||
<p>Taste</p> <p>{taste}</p> | ||
<p>Aroma</p> <p>{smell}</p> | ||
<p>Body</p> <p>{body}</p> | ||
</div> | ||
</div> | ||
</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,2 @@ | ||
import WineTastingCard from "./WineTastingCard"; | ||
export default WineTastingCard; |
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ type Wine = { | |
region: string; | ||
smell: string; | ||
taste: string; | ||
colour: string; | ||
body:string; | ||
users: User[]; | ||
}; |