Skip to content

Commit

Permalink
Reverted CTF event link changes
Browse files Browse the repository at this point in the history
  • Loading branch information
manhualu committed Oct 1, 2023
1 parent f19c500 commit 5c88413
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions client/src/components/timetable/ExpandedEventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import { areValidEventTimes, createDateWithTime } from '../../utils/eventTimes';
import ColorPicker from '../controls/ColorPicker';
import DiscardDialog from './DiscardDialog';
import DropdownOption from './DropdownOption';
import { is } from 'date-fns/locale';

const StyledListItemIcon = styled(ListItemIcon)<ListItemIconProps & { isDarkMode: boolean }>`
color: ${(props) => (props.isDarkMode ? '#FFFFFF' : '#212121')};
Expand Down Expand Up @@ -93,17 +92,6 @@ const ExpandedEventView: React.FC<ExpandedEventViewProps> = ({
setIsChanged(true);
};

const isSpecialEvent = (name: string, color: string, start: number, end: number, day: number, location: string) => {
return (
name.includes('Levelling Up at CSESoc Projects Fair') &&
color === '#a04bd5' &&
day == 2 &&
start == 14.5 &&
end == 16.5 &&
location.includes('Design Studio')
);
};

/**
* @param isChanged Indicates if an edit has been made to the start of the event
* @param newStartTime The new edited start time
Expand Down Expand Up @@ -403,11 +391,7 @@ const ExpandedEventView: React.FC<ExpandedEventViewProps> = ({
<InputAdornment position="end">
<IconButton
onClick={() => {
navigator.clipboard.writeText(
isSpecialEvent(name, color, start, end, day, location)
? 'levelup{eyJ0e}'
: btoa(JSON.stringify(eventPeriod)),
);
navigator.clipboard.writeText(btoa(JSON.stringify(eventPeriod)));
setAutoVisibility(true);
setAlertMsg('Copied to clipboard!');
}}
Expand All @@ -419,11 +403,7 @@ const ExpandedEventView: React.FC<ExpandedEventViewProps> = ({
readOnly: true,
}}
size="small"
value={
isSpecialEvent(name, color, start, end, day, location)
? 'levelup{eyJ0e}'
: btoa(JSON.stringify(eventPeriod))
}
value={btoa(JSON.stringify(eventPeriod))}
></StyledEventLink>
</StyledListItem>
</StyledDialogContent>
Expand Down

0 comments on commit 5c88413

Please sign in to comment.