Skip to content

Commit

Permalink
Package stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
raissaji committed Dec 8, 2024
1 parent 1027ab5 commit a332a24
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 2,713 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/UserTables/ScheduledTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ import RidesTable from './RidesTable';
import styles from './table.module.css';
import { useEmployees } from '../../context/EmployeesContext';
import { useRides } from '../../context/RidesContext';
import { useRiders } from '../../context/RidersContext';

type ScheduledTableProp = {
riderId?: string;
};

const ScheduledTable = ({ riderId }: ScheduledTableProp) => {
const { drivers } = useEmployees();
const { riders } = useRiders();
const [rides, setRides] = useState<Ride[]>([]);
const { scheduledRides } = useRides();

// the ride(s) for the student with the specific riderId
const filteredRides = rides.filter((ride) => ride.rider?.id === riderId);

// check that the rides displayed are associated with this student
filteredRides.forEach((ride) => console.log(ride.rider?.firstName));

const compRides = (a: Ride, b: Ride) => {
const x = new Date(a.startTime);
const y = new Date(b.startTime);
Expand Down
Loading

0 comments on commit a332a24

Please sign in to comment.