Skip to content

Commit

Permalink
fix quality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuignoto committed Feb 13, 2024
1 parent 68f825b commit 130c2a4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 39 deletions.
16 changes: 3 additions & 13 deletions src/components/list/list-item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TimelineModel } from '@models/TimelineModel';
import { FunctionComponent, KeyboardEvent, memo, useCallback } from 'react';
import { CheckIcon } from '../icons';
import { ListItemModel } from './list.model';
import {
CheckboxStyle,
CheckboxWrapper,
Expand All @@ -10,17 +10,7 @@ import {
TitleStyle,
} from './list.styles';

type ListItemProps = {
active?: boolean;
description: string;
id: string;
onClick?: (id: string) => void;
selectable?: boolean;
selected?: boolean;
title: string;
} & Pick<TimelineModel, 'theme'>;

const ListItem: FunctionComponent<ListItemProps> = memo(
const ListItem: FunctionComponent<ListItemModel> = memo(
({
title,
id,
Expand All @@ -30,7 +20,7 @@ const ListItem: FunctionComponent<ListItemProps> = memo(
active,
selected = false,
selectable = false,
}: ListItemProps) => {
}: ListItemModel) => {
const handleOnClick = useCallback((id: string) => onClick?.(id), []);

const handleKeyPress = useCallback((ev: KeyboardEvent, id: string) => {
Expand Down
10 changes: 6 additions & 4 deletions src/components/list/list.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ export type ListModel = {
} & Pick<TimelineModel, 'theme'>;

export type ListItemModel = {
description?: string;
id?: string;
onSelect?: (id?: string) => void;
active?: boolean;
description: string;
id: string;
onClick?: (id: string) => void;
selectable?: boolean;
selected?: boolean;
title: string;
};
} & Pick<TimelineModel, 'theme'>;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const TimelineNavButton = styled.button<{
color: #fff;
cursor: pointer;
display: flex;
// filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.25));
height: 24px;
justify-content: center;
margin: 0 0.2em;
Expand All @@ -55,8 +54,8 @@ export const TimelineNavButton = styled.button<{
}
svg {
width: 60%;
height: 60%;
width: 65%;
height: 65%;
}
`;

Expand Down
19 changes: 0 additions & 19 deletions src/components/timeline/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ const Timeline: React.FunctionComponent<TimelineModel> = (
enableBreakPoint,
);

// useMatchMedia(
// `(min-width: ${verticalBreakPoint + 1}px)`,
// () => {
// setTimelineMode(mode);
// },
// enableBreakPoint,
// );

// handlers for navigation
const handleNext = useCallback(() => {
if (hasFocus) {
Expand Down Expand Up @@ -193,12 +185,6 @@ const Timeline: React.FunctionComponent<TimelineModel> = (
break;
}
}

// const selectedItem = items.find((item) => item.id === itemId);

// if (selectedItem) {
// onItemSelected?.(selectedItem);
// }
}
};

Expand Down Expand Up @@ -334,7 +320,6 @@ const Timeline: React.FunctionComponent<TimelineModel> = (
);

const handleTimelineUpdate = useCallback((mode: string) => {
// console.log(timelineMode);
if (mode === 'VERTICAL') {
setTimelineMode('VERTICAL');
} else if (mode === 'HORIZONTAL') {
Expand All @@ -348,10 +333,6 @@ const Timeline: React.FunctionComponent<TimelineModel> = (
}
}, []);

useEffect(() => {
console.log('this is error', showAllCardsHorizontal);
}, [showAllCardsHorizontal]);

const wrapperClass = useMemo(() => {
return cls(mode.toLocaleLowerCase(), {
'focus-visible': !isChild,
Expand Down

0 comments on commit 130c2a4

Please sign in to comment.