Skip to content

Commit

Permalink
🔀 Merge pull request #49 from Ayush272002/sid-visual-fixes
Browse files Browse the repository at this point in the history
✨ Improved displaying of pricing for users.
  • Loading branch information
siddharth-shringarpure authored Oct 27, 2024
2 parents e60ed2e + 7e91906 commit e8d6678
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#!/usr/bin/env sh
npx lint-staged && npm run build
npm test
27 changes: 23 additions & 4 deletions components/custom/EventDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ const EventDescription: React.FC<EventDescriptionProps> = ({
variant="outline"
className="text-light-purple bg-blue-100 px-3 py-1 rounded-full"
>
Price: ${eventDetails.ticketPrice.toFixed(2)}
{/*Show price and format by separating triplets of digits*/}
Price: $
{eventDetails.ticketPrice.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
</Badge>
</CardHeader>

Expand All @@ -60,9 +65,23 @@ const EventDescription: React.FC<EventDescriptionProps> = ({
<Separator className="my-4" />
<p className="leading-relaxed">{eventDetails.description}</p>
<Separator className="my-4" />
<p><b>Location:</b><br />{eventDetails.location}</p><br />
<p><b>Date:</b><br />{eventDetails.date}</p><br />
<p><b>Host:</b><br />{eventDetails.host}</p>
<p>
<b>Location:</b>
<br />
{eventDetails.location}
</p>
<br />
<p>
<b>Date:</b>
<br />
{eventDetails.date}
</p>
<br />
<p>
<b>Host:</b>
<br />
{eventDetails.host}
</p>
{eventDetails.ticketsSold / eventDetails.capacity >= 0.9 && (
<div className="mt-2 p-2 bg-yellow-300 text-black rounded">
Limited Tickets Remaining!
Expand Down

0 comments on commit e8d6678

Please sign in to comment.