Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"react-router-dom": "^5.1.2",
"tailwindcss": "^4.1.10",
"validator": "^13.7.0",
"vite": "^5.4.19",
"vite-plugin-svgr": "^3.2.0"
"vite": "^6.3.5",
"vite-plugin-svgr": "^4.3.0"
},
"scripts": {
"vite": "vite",
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/ProjectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { styled } from '@mui/material/styles';

import useAuth from '../hooks/useAuth';
import ProjectApiService from '../api/ProjectApiService';
import { ReactComponent as EditIcon } from '../svg/Icon_Edit.svg';
import { ReactComponent as PlusIcon } from '../svg/PlusIcon.svg';
import EditIcon from '../svg/Icon_Edit.svg?react';
import PlusIcon from '../svg/PlusIcon.svg?react';
import ValidatedTextField from './parts/form/ValidatedTextField';
import TitledBox from './parts/boxes/TitledBox';
import ChangesModal from './ChangesModal';
Expand Down Expand Up @@ -234,7 +234,8 @@ export default function ProjectForm({
<Box sx={{ textAlign: 'center' }}>
<Typography variant="h1">Project Management</Typography>
</Box>
{(auth.user.accessLevel === 'admin' || auth.user.accessLevel == 'superadmin' )? (
{auth.user.accessLevel === 'admin' ||
auth.user.accessLevel == 'superadmin' ? (
<TitledBox
title={editMode ? 'Editing Project' : 'Project Information'}
badge={isEdit ? editIcon() : addIcon()}
Expand Down
36 changes: 25 additions & 11 deletions client/src/components/manageProjects/editProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import ProjectForm from '../ProjectForm';
import { simpleInputs, additionalInputsForEdit } from '../data';
import TitledBox from '../parts/boxes/TitledBox';

import { ReactComponent as EditIcon } from '../../svg/Icon_Edit.svg';
import { ReactComponent as PlusIcon } from '../../svg/PlusIcon.svg';
import EditIcon from '../../svg/Icon_Edit.svg?react';
import PlusIcon from '../../svg/PlusIcon.svg?react';

import { Typography, Box } from '@mui/material';

Expand Down Expand Up @@ -106,7 +106,8 @@ const EditProject = ({
setFormData={setFormData}
/>

<TitledBox title="Recurring Events"
<TitledBox
title="Recurring Events"
badge={
<Box
sx={{
Expand Down Expand Up @@ -154,9 +155,12 @@ const EditProject = ({
<h2 className="event-alert">{eventAlert}</h2>
<ul>
{regularEventsState.map((event, index) => (

// eslint-dis able-next-line no-underscore-dangle
<RegularEvent event={event} key={event._id} updateRegularEvent={updateRegularEvent} />
<RegularEvent
event={event}
key={event._id}
updateRegularEvent={updateRegularEvent}
/>
))}
</ul>
</div>
Expand All @@ -168,17 +172,27 @@ const EditProject = ({
function RegularEvent({ event, updateRegularEvent }) {
return (
<li key={`${event.event_id}`}>
<button type="button" onClick={async () => updateRegularEvent({ checkInReady: !event.checkInReady }, event.event_id)}>
<button
type="button"
onClick={async () =>
updateRegularEvent(
{ checkInReady: !event.checkInReady },
event.event_id
)
}
>
<div>{event.name}</div>
<div className="event-list-details">
{`${event.dayOfTheWeek}, ${event.startTime} - ${event.endTime}; ${event.eventType}`} {`${new Date(event.raw.startTime).toLocaleDateString()}`}
{`${event.dayOfTheWeek}, ${event.startTime} - ${event.endTime}; ${event.eventType}`}{' '}
{`${new Date(event.raw.startTime).toLocaleDateString()}`}
</div>
<div className="event-list-description">
Is this event available for check in now?:{' '}
<strong>{`${event.checkInReady ? 'Yes' : 'No'}`}</strong>
</div>
<div className="event-list-description">Is this event available for check in now?: <strong>{`${event.checkInReady ? "Yes" : "No"}`}</strong></div>
</button>
</li>
)
);
}



export default EditProject;
110 changes: 56 additions & 54 deletions client/src/components/presentational/upcomingEvent.jsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,62 @@
import React from "react";
import { ReactComponent as ClockIcon } from "../../svg/Icon_Clock.svg";
import { ReactComponent as LocationIcon } from "../../svg/Icon_Location.svg";
import { Link } from "react-router-dom";
import { Box, Typography } from "@mui/material";
import React from 'react';
import ClockIcon from '../../svg/Icon_Clock.svg?react';
import LocationIcon from '../../svg/Icon_Location.svg?react';
import { Link } from 'react-router-dom';
import { Box, Typography } from '@mui/material';

import moment from "moment";
import moment from 'moment';

const upcomingEvent = (props) => {
return props.nextEvent[0] ? (
<Box className="warning-event">
<Box className="warning-event-headers">
<Typography className="event-name">{props.nextEvent[0].name}</Typography>
<Box className="event-info-wrapper">
<ClockIcon />
<Typography className="event-info" sx={{ margin: '0px 0px 0px 12px' }}>
{moment(props.nextEvent[0].date).format(
"ddd, MMM D @ h:mm a"
)}
</Typography>
</Box>
{props.nextEvent[0].location.city !== "" &&
<Box className="event-info-wrapper">
<LocationIcon />
<Typography className="event-info" sx={{ margin: '0px 0px 0px 12px' }}>
{props.nextEvent[0].location.city},{" "}
{props.nextEvent[0].location.state}
</Typography>
</Box>
}
</Box>
<Box className="warning-event-toggle">
{props.nextEvent[0] && props.isCheckInReady === false ? (
<Link
to={`/events/${props.nextEvent[0]._id}`}
className="checkin-toggle fill-green"
onClick={(e) =>
props.setCheckInReady(e, props.nextEvent[0]._id)
}
>
OPEN CHECK-IN
</Link>
) : (
<Link
to={`/events/${props.nextEvent[0]._id}`}
className="checkin-toggle fill-red"
onClick={(e) =>
props.setCheckInReady(e, props.nextEvent[0]._id)
}
>
CLOSE CHECK-IN
</Link>
)}
</Box>
return props.nextEvent[0] ? (
<Box className="warning-event">
<Box className="warning-event-headers">
<Typography className="event-name">
{props.nextEvent[0].name}
</Typography>
<Box className="event-info-wrapper">
<ClockIcon />
<Typography
className="event-info"
sx={{ margin: '0px 0px 0px 12px' }}
>
{moment(props.nextEvent[0].date).format('ddd, MMM D @ h:mm a')}
</Typography>
</Box>
) : (
<Box>No events coming up!</Box>
);
{props.nextEvent[0].location.city !== '' && (
<Box className="event-info-wrapper">
<LocationIcon />
<Typography
className="event-info"
sx={{ margin: '0px 0px 0px 12px' }}
>
{props.nextEvent[0].location.city},{' '}
{props.nextEvent[0].location.state}
</Typography>
</Box>
)}
</Box>
<Box className="warning-event-toggle">
{props.nextEvent[0] && props.isCheckInReady === false ? (
<Link
to={`/events/${props.nextEvent[0]._id}`}
className="checkin-toggle fill-green"
onClick={(e) => props.setCheckInReady(e, props.nextEvent[0]._id)}
>
OPEN CHECK-IN
</Link>
) : (
<Link
to={`/events/${props.nextEvent[0]._id}`}
className="checkin-toggle fill-red"
onClick={(e) => props.setCheckInReady(e, props.nextEvent[0]._id)}
>
CLOSE CHECK-IN
</Link>
)}
</Box>
</Box>
) : (
<Box>No events coming up!</Box>
);
};
export default upcomingEvent;
Loading
Loading