Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Events Page Violates The Figma Style Guide #3280

Open
wants to merge 12 commits into
base: develop-postgres
Choose a base branch
from
27 changes: 14 additions & 13 deletions src/components/EventCalendar/EventCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
}
};

const handleTodayButton = (): void => {
setCurrentYear(today.getFullYear());
setCurrentMonth(today.getMonth());
setCurrentDate(today.getDate());
};
// const handleTodayButton = (): void => {
// setCurrentYear(today.getFullYear());
// setCurrentMonth(today.getMonth());
// setCurrentDate(today.getDate());
// };

const timezoneString = `UTC${
new Date().getTimezoneOffset() > 0 ? '-' : '+'
Expand Down Expand Up @@ -348,7 +348,7 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
{months[parseInt(holiday.date.slice(0, 2), 10) - 1]}{' '}
{holiday.date.slice(3)}
</span>
<span>{holiday.name}</span>
<span className={styles.holiday_name}>{holiday.name}</span>
</li>
))}
</ul>
Expand All @@ -357,21 +357,21 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
<div className={styles.events_card} role="region" aria-label="Events">
<h3 className={styles.card_title}>Events</h3>
<div className={styles.legend}>
<div className={styles.list_container}>
<span className={styles.holidayIndicator}></span>
<span className={styles.holidayText}>Holidays</span>
</div>
<div className={styles.eventsLegend}>
<span className={styles.organizationIndicator}></span>
<span className={styles.legendText}>
Events Created by Organization
</span>
</div>
<div className={styles.eventsLegend}>
{/* <div className={styles.eventsLegend}>
<span className={styles.userEvents__color}></span>
<span className={styles.legendText}>
Events Created by User
</span>
</div> */}
hustlernik marked this conversation as resolved.
Show resolved Hide resolved
<div className={styles.list_container_holidays}>
<span className={styles.holidayIndicator}></span>
<span className={styles.holidayText}>Holidays</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -547,15 +547,16 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
>
<ChevronRight />
</Button>
<div>
{/* <div>
<Button
className={styles.editButton}
onClick={handleTodayButton}
data-testid="today"

>
Today
</Button>
</div>
</div> */}
</div>
)}
<div className={`${styles.calendar__scroll} customScroll`}>
Expand Down
40 changes: 28 additions & 12 deletions src/components/EventCalendar/EventHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Button, Form } from 'react-bootstrap';
import { Search } from '@mui/icons-material';
import SearchOutlinedIcon from '@mui/icons-material/SearchOutlined';
import AddIcon from '@mui/icons-material/Add';
import styles from '../../style/app.module.css';
import { ViewType } from '../../screens/OrganizationEvents/OrganizationEvents';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -35,7 +36,10 @@ function eventHeader({
});

return (
<div className={styles.calendarEventHeader}>
<div
className={styles.calendarEventHeader}
data-testid="calendarEventHeader"
>
<div className={styles.calendar__header}>
<div className={styles.input}>
<Form.Control
Expand All @@ -57,12 +61,13 @@ function eventHeader({
/>
<Button
className={styles.searchButton}
data-testid="searchButton"
style={{ marginBottom: '10px' }}
>
<Search />
<SearchOutlinedIcon />
</Button>
</div>
<div className={styles.flex_grow}></div>
{/* <div className={styles.flex_grow}></div> */}
<div className={styles.space}>
<SortingButton
title={t('viewType')}
Expand All @@ -88,14 +93,25 @@ function eventHeader({
className={styles.dropdown}
buttonLabel={t('eventType')}
/>
<Button
variant="success"
className={styles.dropdown}
onClick={showInviteModal}
data-testid="createEventModalBtn"
>
Create Event
</Button>
<div className={styles.selectTypeEventHeader}>
<Button
variant="success"
className={styles.dropdown}
onClick={showInviteModal}
data-testid="createEventModalBtn"
>
<div className="">
<AddIcon
sx={{
fontSize: '25px',
marginBottom: '2px',
marginRight: '2px',
}}
/>
<span>Create</span>
</div>
</Button>
</div>
</div>
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion src/components/EventCalendar/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ export const holidays = [
},
{ name: 'Christmas Day', date: '12-25', month: 'December' }, // December 25th
];
export const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
export const weekdays = [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
];
export const months = [
'January',
'February',
Expand Down
12 changes: 0 additions & 12 deletions src/components/HolidayCards/HolidayCard.module.css

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/HolidayCards/HolidayCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styles from './HolidayCard.module.css';
import styles from './../../style/app.module.css';

// Props for the HolidayCard component
interface InterfaceHolidayList {
Expand All @@ -14,7 +14,7 @@ interface InterfaceHolidayList {
*/
const HolidayCard = (props: InterfaceHolidayList): JSX.Element => {
/*istanbul ignore next*/
return <div className={styles.card}>{props?.holidayName}</div>;
return <div className={styles.holidayCard}>{props?.holidayName}</div>;
};

export default HolidayCard;
2 changes: 1 addition & 1 deletion src/screens/UserPortal/Events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default function events(): JSX.Element {
return (
<>
<div className={`d-flex flex-row`}>
<div className={`${styles.mainContainer}`}>
<div className={`${styles.mainContainerEvent}`}>
<EventHeader
viewType={viewType}
showInviteModal={showInviteModal}
Expand Down
Loading
Loading