Skip to content

Commit

Permalink
vendor runsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
amykapernick committed Jul 31, 2024
1 parent a47f20b commit b950109
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/fetchData/schedules/vendor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const FetchData = async (props: FetchGuestRunsheetProps) => {
return (
<>
{email.toLowerCase() && <TrackEvent name="Signed In" />}
<Schedule {...scheduleData} />
<Schedule {...scheduleData} vendor={vendor} />
</>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Dialog from "@components/dialog";

type ScheduleProps = {
type: "guest" | "vendor";
vendor?: string
events: RunsheetEvent[];
startDate: Date;
endDate: Date;
Expand All @@ -23,7 +24,7 @@ type CustomLocalizer = DateLocalizer & {
}

const Schedule = (props: ScheduleProps) => {
const { startDate, endDate, type } = props;
const { startDate, endDate, type, vendor } = props;
const numDays = differenceInCalendarDays(endDate, startDate) !== 1 ? differenceInCalendarDays(endDate, startDate) + 1 : differenceInCalendarDays(endDate, startDate);
const [events, setEvents] = useState<Event[]>(props?.events ?? [])
const [view, setView] = useState<View>(views.default)
Expand Down Expand Up @@ -88,6 +89,7 @@ const Schedule = (props: ScheduleProps) => {
}
}, [props])

console.log({vendor})

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/styles/config/colours.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const colours = {
white: '#ffffff',
black: '#0c0c0c',
neutral: '@black',
background: '@green_light',
background: '@green_white',
blue: '#0067b7',
purple: '#9440a0',
blue_light: '#3eccfd',
Expand Down
17 changes: 1 addition & 16 deletions utils/formatSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@ const formatSchedule = (props: formatRunsheetProps) =>

if (type === 'guest')
{
// if (eventData.name == "Secret Family Shenanigans")
// {
// // console.log({ ...event.properties.Guests.rollup.array })
// console.log({
// guestIds: event.properties.Guests.rollup.array
// .map(array => array.relation
// .map(({ id }) => id)
// .join(',')
// ).join(',')
// })
// // console.log({ ...event.properties.GuestIds })
// }

event.properties.Guests.rollup.array
.map(array => array.relation
.map(({ id }) => id)
Expand All @@ -73,8 +60,6 @@ const formatSchedule = (props: formatRunsheetProps) =>
// formattedEvents[vendor].eventIds.push(event.id)
// }

console.log({ guests: eventData.guests })

if (eventData.guests.length === Object.entries(guests).length - 1)
{
eventData.guests = [guestName]
Expand All @@ -91,7 +76,7 @@ const formatSchedule = (props: formatRunsheetProps) =>
startDate,
endDate,
guests,
type
type,
}
}

Expand Down

0 comments on commit b950109

Please sign in to comment.