Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Wu <[email protected]>
  • Loading branch information
xgraceyan and KevinWu098 authored Jan 6, 2025
1 parent 86218bf commit 9cfaf69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function CustomEventDialogs(props: CustomEventDialogProps) {
</Tooltip>
)}
<Dialog open={open} onClose={handleClose} maxWidth={'xs'}>
<DialogTitle id="form-dialog-title" style={{ marginBottom: -10 }}>
<DialogTitle id="form-dialog-title">
Add a Custom Event
</DialogTitle>
<DialogContent>
Expand All @@ -179,10 +179,9 @@ function CustomEventDialogs(props: CustomEventDialogProps) {
required={true}
value={title}
onChange={handleEventNameChange}
style={{ marginTop: 10, width: '100%' }}
/>
</FormControl>
<form noValidate style={{ display: 'flex', gap: 0, marginTop: 10 }}>
<FormControl fullWidth sx={{ display: 'flex', flexDirection: 'row', gap: '10px' }}>
<TextField
onChange={handleStartTimeChange}
label="Start Time"
Expand All @@ -195,7 +194,6 @@ function CustomEventDialogs(props: CustomEventDialogProps) {
inputProps={{
step: 300,
}}
style={{ marginRight: 5, marginTop: 10 }}
/>
<TextField
onChange={handleEndTimeChange}
Expand All @@ -209,7 +207,6 @@ function CustomEventDialogs(props: CustomEventDialogProps) {
inputProps={{
step: 300,
}}
style={{ marginTop: 10 }}
/>
</form>
<DaySelector onSelectDay={handleDayChange} days={props.customEvent?.days} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ const DaySelector = ({ days = [false, false, false, false, false, false, false],
marginLeft: -5,
marginRight: -5,
}}
style={{ gap: '10px' }}
>
{normal_days.map((day, index) => (
<Button
key={index}
variant={selectedDays[index] ? 'contained' : 'outlined'}
size="small"
fullWidth
onClick={() => {
handleChange(index);
}}
onClick={() => handleChange(index)}
color={'default'}
style={{
display: 'block',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import MenuItem from '@mui/material/MenuItem';
import OutlinedInput from '@mui/material/OutlinedInput';
import Select, { SelectChangeEvent } from '@mui/material/Select';
import type { RepeatingCustomEvent } from '@packages/antalmanac-types';
import { int } from 'aws-sdk/clients/datapipeline';
import { PureComponent } from 'react';

interface ScheduleSelectorProps {
Expand Down Expand Up @@ -49,13 +48,13 @@ class ScheduleSelector extends PureComponent<ScheduleSelectorProps, ScheduleSele
input={<OutlinedInput id="select-multiple-chip" label="Chip" />}
renderValue={(selected) => (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
{selected.map((value: int) => {
{selected.map((value: number) => {
return <Chip key={value} label={this.props.scheduleNames[value]} />;
})}
</Box>
)}
>
{this.props.scheduleNames.map((name: string, index: int) => {
{this.props.scheduleNames.map((name: string, index: number) => {
return (
<MenuItem key={index} value={index}>
{name}
Expand Down

0 comments on commit 9cfaf69

Please sign in to comment.