Skip to content

Commit

Permalink
merged changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Zheng committed Apr 12, 2024
2 parents 8a097d6 + a05e92d commit 5c94878
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions components/Organizer/ApplicantsTab/ApplicantsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const ApplicantsTab = () => {
{
title: 'Login Name',
dataIndex: 'name',
...getColumnSearchProps('name'),
},
{
title: 'First Name',
Expand Down
9 changes: 4 additions & 5 deletions components/judges/ScoreInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Slider, Radio , InputNumber, Row, Col } from 'antd';
import { Slider, Radio, InputNumber, Row, Col } from 'antd';
import { RadioChangeEvent } from 'antd/lib';
import { IntegerType } from 'mongodb';
import styles from '../../styles/Judge.module.css';
Expand All @@ -14,9 +14,9 @@ export default function ScoreInput(props: ScoreInputProps) {
const { value, onChange } = props;
const [min, max] = [0, 7];
const onRadioChange = (e: RadioChangeEvent) => {
onChange(e.target.value);
};
onChange(e.target.value);
};

return (
<Row>
<Col flex={1/4}>
Expand All @@ -29,7 +29,6 @@ export default function ScoreInput(props: ScoreInputProps) {
<Radio className={styles.CustomRadio} value={6}>6</Radio>
<Radio className={styles.CustomRadio} value={7}>7</Radio>
</Radio.Group>

</Col>
<Col span={4}>
<InputNumber
Expand Down
33 changes: 17 additions & 16 deletions components/judges/schedule.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Space, Table, Collapse, Tag, Switch, Button, notification, Upload, Spin, theme } from 'antd';
import { Space, Table, Collapse, Tag, Switch, Button, notification, Upload, Spin, theme, Radio } from 'antd';
import React, { useContext, useMemo, useState } from 'react';
import { DateTime } from 'luxon';
import Link from 'next/link';
Expand Down Expand Up @@ -89,7 +89,7 @@ export default function OrganizerSchedule(props: ScheduleProps) {
.filter(x => x.team !== null && x.team.name !== null)
.find(x => x.team.name === teamName)?.team.locationNum;
return {
title: (teamName as string) + ' (Table ' + locationNum + ')',
title: teamName as string,
dataIndex: teamName as string,
key: teamName as string,
render: TableCell,
Expand Down Expand Up @@ -183,7 +183,7 @@ export default function OrganizerSchedule(props: ScheduleProps) {
}

export function JudgeSchedule({ data, cutoffIndex, handleChange }: ScheduleProps) {
const [showPast, setShowPast] = useState(true);
const [showPast, setShowPast] = useState(false);
const { accentColor, baseTheme } = useContext(ThemeContext);

const columns = [
Expand All @@ -194,16 +194,21 @@ export function JudgeSchedule({ data, cutoffIndex, handleChange }: ScheduleProps
width: '10%',
render: (date: string) => DateTime.fromISO(date).toLocaleString(DateTime.TIME_SIMPLE),
},
{
title: 'Table',
dataIndex: 'table',
key: 'table',
width: '10%',
render: (locationNum: number) => locationNum,
},
{
title: 'Project',
dataIndex: 'project',
key: 'project',
width: '40%',
render: ({ name, link, locationNum }: { name: string; link: URL; locationNum: number }) => (
width: '30%',
render: ({ name, link }: { name: string; link: URL }) => (
<>
<td>
{name} (Table {locationNum})
</td>
<td>{name}</td>
<Link href={link} passHref>
<a
style={{ color: getAccentColor(accentColor, baseTheme), textDecoration: 'underline' }}
Expand Down Expand Up @@ -243,7 +248,8 @@ export function JudgeSchedule({ data, cutoffIndex, handleChange }: ScheduleProps
const dataSource = data.slice(showPast ? 0 : cutoffIndex).map(item => {
return {
time: item.time,
project: { name: item.team.name, link: new URL(item.team.devpost), locationNum: item.team.locationNum },
table: item.team.locationNum,
project: { name: item.team.name, link: new URL(item.team.devpost) },
teamMembers: item.team.members,
judge: item.judge,
teamId: item.team._id,
Expand All @@ -269,13 +275,8 @@ export function JudgeSchedule({ data, cutoffIndex, handleChange }: ScheduleProps
<Table.Summary fixed={true}>
<Table.Summary.Row>
<Table.Summary.Cell index={0} colSpan={6}>
<Switch
checkedChildren="Hide past sessions"
unCheckedChildren="Include past sessions"
onChange={checked => {
setShowPast(checked);
}}
/>
<Radio checked={showPast} onClick={() => setShowPast(!showPast)} />
Show Past Sessions
</Table.Summary.Cell>
</Table.Summary.Row>
</Table.Summary>
Expand Down

0 comments on commit 5c94878

Please sign in to comment.