-
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 #149 from Blueprint-Boulder/UpdateVendorPage
Update vendor page
- Loading branch information
Showing
16 changed files
with
516 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, {useState, useContext, useEffect} from 'react'; | ||
import {Context} from '../services/context'; | ||
import LeavingPageIcon from '../components/LeavingPageIcon'; | ||
|
||
export default function AttendingEvents({vendorId, vendorService}){ | ||
const [events, setEvents] = useState([]); | ||
|
||
// Parses the start / end time to a human readable format | ||
const timeFormat = new Intl.DateTimeFormat('en', { | ||
timeStyle: 'short', | ||
dateStyle: 'short', | ||
}); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
setEvents(await vendorService.getVendorEvents(vendorId)); | ||
})(); | ||
}, [vendorId, vendorService]); | ||
|
||
return <table className='w-full my-2'><tbody> | ||
{ | ||
events !== undefined ? events.map((event) => { | ||
return <tr className='border-b border-black border-opacity-30'> | ||
<td><a className='py-1 flex flex-row justify-around' href={`/events/${event.event_id}`}><p>{event.name}</p><LeavingPageIcon/></a></td> | ||
<td align='right' className='py-1 content-end'>{timeFormat.format(Date.parse(event.starttime))}</td> | ||
</tr> | ||
}) : <></> | ||
} | ||
</tbody></table> | ||
} |
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 LeavingPageIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
shape-rendering="geometricPrecision" | ||
text-rendering="geometricPrecision" | ||
image-rendering="optimizeQuality" | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
viewBox="0 0 509 511.54" | ||
aria-label="Leaving Page Icon" | ||
width={"1rem"} | ||
> | ||
<path fill-rule="nonzero" d="M447.19 347.03c0-17.06 13.85-30.91 30.91-30.91 17.05 0 30.9 13.85 30.9 30.91v87.82c0 21.08-8.63 40.29-22.51 54.18-13.88 13.88-33.09 22.51-54.18 22.51H76.69c-21.09 0-40.3-8.63-54.18-22.51C8.63 475.14 0 455.93 0 434.85V76.69c0-21.09 8.63-40.3 22.51-54.18C36.39 8.63 55.6 0 76.69 0h86.98c17.06 0 30.9 13.85 30.9 30.9 0 17.06-13.84 30.91-30.9 30.91H76.69c-4.07 0-7.82 1.69-10.51 4.37-2.68 2.69-4.37 6.44-4.37 10.51v358.16c0 4.06 1.69 7.82 4.37 10.5 2.69 2.68 6.44 4.38 10.51 4.38h355.62c4.07 0 7.82-1.7 10.51-4.38 2.68-2.68 4.37-6.44 4.37-10.5v-87.82zm0-243.56L308.15 244.28c-11.91 12.12-31.45 12.28-43.56.37-12.11-11.91-12.28-31.45-.37-43.56L401.77 61.81H309.7c-17.06 0-30.9-13.85-30.9-30.91 0-17.05 13.84-30.9 30.9-30.9h168.4C495.15 0 509 13.85 509 30.9v165.04c0 17.06-13.85 30.9-30.9 30.9-17.06 0-30.91-13.84-30.91-30.9v-92.47z"/> | ||
</svg> | ||
); | ||
} |
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
Oops, something went wrong.