Skip to content

Commit

Permalink
fix: Remove wrong types to fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jul 9, 2024
1 parent 2ec5a6f commit 4f46250
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/generic/block-type-utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const TYPE_ICONS_MAP: Record<string, React.ReactElement> = {
lock: LockIcon,
};

export const COMPONENT_TYPE_ICON_MAP: Record<string, React.ReactElement> = {
export const COMPONENT_TYPE_ICON_MAP = {
[COMPONENT_TYPES.advanced]: ScienceIcon,
[COMPONENT_TYPES.discussion]: QuestionAnswerOutlineIcon,
[COMPONENT_TYPES.library]: LibraryIcon,
Expand All @@ -47,7 +47,7 @@ export const COMPONENT_TYPE_ICON_MAP: Record<string, React.ReactElement> = {
[COMPONENT_TYPES.dragAndDrop]: BackHandIcon,
};

export const STRUCTURAL_TYPE_ICONS: Record<string, React.ReactElement> = {
export const STRUCTURAL_TYPE_ICONS = {
vertical: TYPE_ICONS_MAP.vertical,
sequential: Folder,
chapter: Folder,
Expand Down
3 changes: 1 addition & 2 deletions src/generic/block-type-utils/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import { Article } from '@openedx/paragon/icons';
import {
COMPONENT_TYPE_ICON_MAP,
STRUCTURAL_TYPE_ICONS,
COMPONENT_TYPE_COLOR_MAP,
} from './constants';

export function getItemIcon(blockType: string): React.ReactElement {
export function getItemIcon(blockType: string) {
return STRUCTURAL_TYPE_ICONS[blockType] ?? COMPONENT_TYPE_ICON_MAP[blockType] ?? Article;
}

Expand Down
2 changes: 1 addition & 1 deletion src/search-manager/SearchFilterWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SearchFilterWidget: React.FC<{
label: React.ReactNode;
children: React.ReactNode;
clearFilter: () => void,
icon?: React.ReactNode; // eslint-disable-line react/require-default-props
icon?: React.ComponentType<{}> | undefined; // eslint-disable-line react/require-default-props
}> = ({ appliedFilters, ...props }) => {
const intl = useIntl();
const [isOpen, open, close] = useToggle(false);
Expand Down

0 comments on commit 4f46250

Please sign in to comment.