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

fixed #2505 :Refactor CSS Structure for EventVolunteers: Improved Maintainability and UI Consistency #2675

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ describe('Testing OrganizationScreen', () => {
const openButton = screen.getByTestId('openMenu');
fireEvent.click(openButton);

// Check for expand class after opening
expect(screen.getByTestId('mainpageright')).toHaveClass(styles.contract);
});

Expand Down
266 changes: 0 additions & 266 deletions src/screens/EventVolunteers/EventVolunteers.module.css

This file was deleted.

22 changes: 11 additions & 11 deletions src/screens/EventVolunteers/Requests/Requests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
type GridColDef,
} from '@mui/x-data-grid';
import Avatar from 'components/Avatar/Avatar';
import styles from '../EventVolunteers.module.css';
import styles from '../../../style/app.module.css';
import { USER_VOLUNTEER_MEMBERSHIP } from 'GraphQl/Queries/EventVolunteerQueries';
import type { InterfaceVolunteerMembership } from 'utils/interfaces';
import dayjs from 'dayjs';
Expand Down Expand Up @@ -154,7 +154,7 @@ function requests(): JSX.Element {
align: 'center',
headerAlign: 'center',
sortable: false,
headerClassName: `${styles.tableHeader}`,
headerClassName: `${styles.tableHeaders}`,
renderCell: (params: GridCellParams) => {
return params.row.id;
},
Expand All @@ -167,7 +167,7 @@ function requests(): JSX.Element {
minWidth: 100,
headerAlign: 'center',
sortable: false,
headerClassName: `${styles.tableHeader}`,
headerClassName: `${styles.tableHeaders}`,
renderCell: (params: GridCellParams) => {
const { firstName, lastName, image } = params.row.volunteer.user;
return (
Expand All @@ -180,14 +180,14 @@ function requests(): JSX.Element {
src={image}
alt="volunteer"
data-testid={`volunteer_image`}
className={styles.TableImage}
className={styles.TableImages}
/>
) : (
<div className={styles.avatarContainer}>
<Avatar
key="volunteer_avatar"
containerStyle={styles.imageContainer}
avatarStyle={styles.TableImage}
avatarStyle={styles.TableImages}
name={firstName + ' ' + lastName}
alt={firstName + ' ' + lastName}
/>
Expand All @@ -205,7 +205,7 @@ function requests(): JSX.Element {
minWidth: 150,
align: 'center',
headerAlign: 'center',
headerClassName: `${styles.tableHeader}`,
headerClassName: `${styles.tableHeaders}`,
sortable: false,
renderCell: (params: GridCellParams) => {
return dayjs(params.row.createdAt).format('DD/MM/YYYY');
Expand All @@ -219,7 +219,7 @@ function requests(): JSX.Element {
minWidth: 100,
headerAlign: 'center',
sortable: false,
headerClassName: `${styles.tableHeader}`,
headerClassName: `${styles.tableHeaders}`,
renderCell: (params: GridCellParams) => {
return (
<>
Expand Down Expand Up @@ -251,7 +251,7 @@ function requests(): JSX.Element {
return (
<div>
{/* Header with search, filter and Create Button */}
<div className={`${styles.btnsContainer} gap-4 flex-wrap`}>
<div className={`${styles.btnsContainer} btncon gap-4 flex-wrap`}>
<div className={`${styles.input} mb-1`}>
<Form.Control
type="name"
Expand All @@ -260,7 +260,7 @@ function requests(): JSX.Element {
})}
autoComplete="off"
required
className={styles.inputField}
className={styles.inputFields}
value={searchValue}
onChange={(e) => {
setSearchValue(e.target.value);
Expand All @@ -282,7 +282,7 @@ function requests(): JSX.Element {
<Dropdown>
<Dropdown.Toggle
variant="success"
className={styles.dropdown}
className={styles.dropdowns}
data-testid="sort"
>
<Sort className={'me-1'} />
Expand Down Expand Up @@ -316,7 +316,7 @@ function requests(): JSX.Element {
hideFooter={true}
getRowId={(row) => row._id}
sx={dataGridStyle}
getRowClassName={() => `${styles.rowBackground}`}
getRowClassName={() => `${styles.rowBackgrounds}`}
autoHeight
rowHeight={65}
rows={requests.map((request, index) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/screens/EventVolunteers/VolunteerContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Navigate, useParams } from 'react-router-dom';
import styles from './EventVolunteers.module.css';
import styles from '../../style/app.module.css';
import { HiUserGroup, HiUser } from 'react-icons/hi2';
import Volunteers from './Volunteers/Volunteers';
import VolunteerGroups from './VolunteerGroups/VolunteerGroups';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Modal } from 'react-bootstrap';
import styles from '../EventVolunteers.module.css';
import styles from '../../../style/app.module.css';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useMutation } from '@apollo/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
InterfaceUserInfo,
InterfaceVolunteerGroupInfo,
} from 'utils/interfaces';
import styles from '../EventVolunteers.module.css';
import styles from '../../../style/app.module.css';
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useMutation, useQuery } from '@apollo/client';
Expand Down
Loading
Loading