chore: use export function instead of React.FC
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { DAY_MAP } from 'src/shared/types/CourseMeeting';
|
import { DAY_MAP } from 'src/shared/types/CourseMeeting';
|
||||||
import styles from './CalendarGrid.module.scss';
|
import styles from './CalendarGrid.module.scss';
|
||||||
import CalendarCell from '../CalendarGridCell/CalendarGridCell';
|
import CalendarCell from '../CalendarGridCell/CalendarGridCell';
|
||||||
|
import { CourseMeeting } from 'src/shared/types/CourseMeeting';
|
||||||
|
|
||||||
const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['S', 'SU'].includes(key));
|
const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['S', 'SU'].includes(key));
|
||||||
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
|
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
|
||||||
@@ -20,11 +21,17 @@ for (let i = 0; i < 13; i++) {
|
|||||||
grid.push(row);
|
grid.push(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
CourseMeetingBlocks: CourseMeeting[];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grid of CalendarGridCell components forming the user's course schedule calendar view
|
* Grid of CalendarGridCell components forming the user's course schedule calendar view
|
||||||
* @param props
|
* @param props
|
||||||
*/
|
*/
|
||||||
const Calendar: React.FC = props => (
|
export function Calendar({ CourseMeetingBlocks }: React.PropsWithChildren<Props>): JSX.Element {
|
||||||
|
|
||||||
|
return (
|
||||||
<div className={styles.calendar}>
|
<div className={styles.calendar}>
|
||||||
<div className={styles.dayLabelContainer} />
|
<div className={styles.dayLabelContainer} />
|
||||||
{/* Displaying the rest of the calendar */}
|
{/* Displaying the rest of the calendar */}
|
||||||
@@ -52,5 +59,6 @@ const Calendar: React.FC = props => (
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
);
|
||||||
|
|
||||||
export default Calendar;
|
export default Calendar;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Text from '../Text/Text';
|
import Text from '../Text/Text';
|
||||||
|
|
||||||
|
export const flags = ['WR', 'QR', 'GC', 'CD', 'E', 'II'];
|
||||||
export const flags = ["WR", "QR", "GC", "CD", "E", "II"]
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -12,15 +11,16 @@ interface Props {
|
|||||||
* A reusable chip component that follows the design system of the extension.
|
* A reusable chip component that follows the design system of the extension.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function Chip({
|
export function Chip({ label }: React.PropsWithChildren<Props>): JSX.Element {
|
||||||
label
|
|
||||||
}: React.PropsWithChildren<Props>): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<Text as = 'div' variant = 'h4'
|
<Text
|
||||||
className="min-w-5 inline-flex items-center justify-center gap-2.5 rounded-lg px-1 py-0.5"
|
as='div'
|
||||||
|
variant='h4'
|
||||||
|
className='min-w-5 inline-flex items-center justify-center gap-2.5 rounded-lg px-1 py-0.5'
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#FFD600"
|
backgroundColor: '#FFD600',
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
{label}
|
{label}
|
||||||
</Text>
|
</Text>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user