Skip to content
Open
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 @@ -33,7 +33,7 @@ vi.mock('react-router', async (importOriginal) => {
});

// Mock IconComponent to expose fill prop for testing
vi.mock('components/IconComponent/IconComponent', () => ({
vi.mock('shared-components/IconComponent/IconComponent', () => ({
default: ({ name, fill }: { name: string; fill?: string }) => (
<div data-testid="mocked-icon-component" data-name={name} data-fill={fill}>
{name}Icon
Expand Down
12 changes: 5 additions & 7 deletions src/components/CollapsibleDropdown/CollapsibleDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
* controlled by the `showDropdown` state, and it automatically toggles
* based on the current route.
*
* @component
* @param {InterfaceCollapsibleDropdown} props - The props for the component.
* @param {object} props.target - The target object containing the dropdown's name and sub-targets.
* @param {boolean} props.showDropdown - A boolean indicating whether the dropdown is currently visible.
* @param {React.Dispatch<React.SetStateAction<boolean>>} props.setShowDropdown - A function to toggle the dropdown's visibility.
* @param target - The target object containing the dropdown's name and sub-targets.
* @param showDropdown - A boolean indicating whether the dropdown is currently visible.
* @param setShowDropdown - A function to toggle the dropdown's visibility.
*
* @returns {JSX.Element} The collapsible dropdown component.
* @returns The collapsible dropdown component.
*
* @remarks
* - The dropdown automatically opens if the current route includes 'orgstore'.
Expand All @@ -31,7 +29,7 @@
* />
* ```
*
* @dependencies

Check failure on line 32 in src/components/CollapsibleDropdown/CollapsibleDropdown.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-undefined-tag: The TSDoc tag "@Dependencies" is not defined in this configuration
* - `react-bootstrap/Collapse` for dropdown animation.
* - `react-router-dom` for navigation and route handling.
* - `react-i18next` for internationalization support.
Expand All @@ -40,7 +38,7 @@
import React, { useEffect } from 'react';
import { Collapse } from 'react-bootstrap';
import styles from 'style/app-fixed.module.css';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import { NavLink, useLocation, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import type { InterfaceCollapsibleDropdown } from 'types/DropDown/interface';
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventStats/EventStatsWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
* <EventStatsWrapper _id="12345" />
* ```
*
* @component

Check failure on line 22 in src/components/EventStats/EventStatsWrapper.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-undefined-tag: The TSDoc tag "@component" is not defined in this configuration
* @category Event Management

Check failure on line 23 in src/components/EventStats/EventStatsWrapper.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-undefined-tag: The TSDoc tag "@category" is not defined in this configuration
* @subcategory Statistics

Check failure on line 24 in src/components/EventStats/EventStatsWrapper.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-undefined-tag: The TSDoc tag "@subcategory" is not defined in this configuration
*
* @dependencies

Check failure on line 26 in src/components/EventStats/EventStatsWrapper.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-undefined-tag: The TSDoc tag "@Dependencies" is not defined in this configuration
* - `react-bootstrap/Button`: For rendering the button to toggle the modal.
* - `components/IconComponent`: For displaying an icon inside the button.
* - `style/app-fixed.module.css`: For styling the button's icon wrapper.
Expand All @@ -32,7 +32,7 @@
import React, { useState } from 'react';
import { EventStats } from './Statistics/EventStats';
import { Button } from 'react-bootstrap';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import styles from 'style/app-fixed.module.css';

export const EventStatsWrapper = ({ _id }: { _id: string }): JSX.Element => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ vi.mock('components/CollapsibleDropdown/CollapsibleDropdown', () => ({
)),
}));

vi.mock('components/IconComponent/IconComponent', () => ({
vi.mock('shared-components/IconComponent/IconComponent', () => ({
default: vi.fn(({ name, fill }) => (
<div data-testid="icon-component" data-name={name} data-fill={fill}>
{name}Icon
Expand Down
2 changes: 1 addition & 1 deletion src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

import CollapsibleDropdown from 'components/CollapsibleDropdown/CollapsibleDropdown';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserPortal/UserSidebar/UserSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* - The sidebar adapts its visibility based on the `hideDrawer` prop and viewport width.
* - **REFACTORED**: Now uses shared SidebarBase, SidebarNavItem, and SidebarPluginSection components
*
* @param {InterfaceUserSidebarProps} props - The props for the UserSidebar component.

Check failure on line 15 in src/components/UserPortal/UserSidebar/UserSidebar.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-param-tag-with-invalid-type: The @param block should not include a JSDoc-style '{type}'
* @param {boolean} props.hideDrawer - Determines the visibility of the sidebar.

Check failure on line 16 in src/components/UserPortal/UserSidebar/UserSidebar.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag

Check failure on line 16 in src/components/UserPortal/UserSidebar/UserSidebar.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"

Check failure on line 16 in src/components/UserPortal/UserSidebar/UserSidebar.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-param-tag-with-invalid-type: The @param block should not include a JSDoc-style '{type}'

Check failure on line 16 in src/components/UserPortal/UserSidebar/UserSidebar.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, unused file detection, checking for different source...

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param {React.Dispatch<React.SetStateAction<boolean>>} props.setHideDrawer -
* Function to update the `hideDrawer` state.
*
Expand All @@ -32,7 +32,7 @@
import { usePluginDrawerItems } from 'plugin';
import ProfileCard from 'components/ProfileCard/ProfileCard';
import SignOut from 'components/SignOut/SignOut';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import SidebarBase from 'shared-components/SidebarBase/SidebarBase';
import SidebarNavItem from 'shared-components/SidebarNavItem/SidebarNavItem';
import SidebarPluginSection from 'shared-components/SidebarPluginSection/SidebarPluginSection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

import CollapsibleDropdown from 'components/CollapsibleDropdown/CollapsibleDropdown';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import React, { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import type { TargetsType } from 'state/reducers/routesReducer';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/AdminPortal/ManageTag/ManageTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import React, { useEffect, useState } from 'react';
import { useMutation, useQuery } from '@apollo/client';
import { WarningAmberRounded } from '@mui/icons-material';
import LoadingState from 'shared-components/LoadingState/LoadingState';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import { useNavigate, useParams, Link } from 'react-router';
import { Col } from 'react-bootstrap';
import Button from 'react-bootstrap/Button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Modal from 'react-bootstrap/Modal';
import Row from 'react-bootstrap/Row';
import { useTranslation } from 'react-i18next';
import { NotificationToast } from 'components/NotificationToast/NotificationToast';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import LoadingState from 'shared-components/LoadingState/LoadingState';
import type { InterfaceTagDataPG } from 'utils/interfaces';
import styles from 'style/app-fixed.module.css';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/AdminPortal/SubTags/SubTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
import { useMutation, useQuery } from '@apollo/client';
import { WarningAmberRounded } from '@mui/icons-material';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import LoadingState from 'shared-components/LoadingState/LoadingState';
import { useNavigate, useParams, Link } from 'react-router';
import type { ChangeEvent } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/AdminPortal/Users/Users.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vi.mock('@mui/icons-material', async () => {
};
});

vi.mock('components/IconComponent/IconComponent', () => ({
vi.mock('shared-components/IconComponent/IconComponent', () => ({
default: ({ name }: { name: string }) => (
<div data-testid={`mock-icon-${name}`} />
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
import React from 'react';
import { Stack, Typography } from '@mui/material';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';

interface InterfaceDataGridErrorOverlayProps {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/shared-components/EmptyState/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Stack, Button, Typography } from '@mui/material';
import IconComponent from 'components/IconComponent/IconComponent';
import IconComponent from 'shared-components/IconComponent/IconComponent';
import type { InterfaceEmptyStateProps } from 'types/shared-components/EmptyState/interface';

const EmptyState: React.FC<InterfaceEmptyStateProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ import ExitToAppIcon from '@mui/icons-material/ExitToApp';
import { MdOutlineVolunteerActivism } from 'react-icons/md';

import type { JSX } from 'react';

export interface IIconComponent {
name: string;
fill?: string;
height?: string;
width?: string;
}
import type { IIconComponent } from 'types/shared-components/IconComponent';

const iconComponent = (props: IIconComponent): JSX.Element => {
switch (props.name) {
Expand Down
10 changes: 10 additions & 0 deletions src/types/shared-components/IconComponent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* IconComponent type definitions
*/

export interface IIconComponent {
name: string;
fill?: string;
height?: string;
width?: string;
}
Loading