Skip to content

Commit

Permalink
chore: remove duplicated codes
Browse files Browse the repository at this point in the history
  • Loading branch information
belapferreira committed Nov 11, 2023
1 parent e876024 commit c7f6874
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
42 changes: 1 addition & 41 deletions src/app/components/Accordion/AccordionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ import { ComponentProps, ComponentRef, forwardRef, useMemo } from 'react';
import * as Accordion from '@radix-ui/react-accordion';
import Markdown from 'react-markdown';

import {
Divider,
IconWorld16,
IconTextBox16,
IconMessages16,
IconVisualizationPie16,
IconVisualizationLine16,
IconVisualizationGauge16,
IconVisualizationColumn16,
IconVisualizationLineMulti16,
IconVisualizationPivotTable16,
IconVisualizationBarStacked16,
} from '@dhis2/ui';

import { useDashboards, INITIAL_OPTIONS_VALUE } from '@/hooks/useDashboards';

import { Loader } from '@/app/components/Loader';
Expand All @@ -34,25 +20,8 @@ import {
IconVisualizationBarStacked16,
} from '@dhis2/ui';

import { DashboardItems } from '@/hooks/queries/useGetDashboardItemsById';

import { Loader } from '@/app/components/Loader';

type AccordionContentProps = ComponentProps<typeof Accordion.Content>;

const ICON = {
MAP: IconWorld16,
TEXT: IconTextBox16,
MESSAGES: IconMessages16,
PIE: IconVisualizationPie16,
LINE: IconVisualizationLine16,
GAUGE: IconVisualizationGauge16,
COLUMN: IconVisualizationColumn16,
PIVOT_TABLE: IconVisualizationPivotTable16,
STACKED_COLUMN: IconVisualizationBarStacked16,
YEAR_OVER_YEAR_LINE: IconVisualizationLineMulti16,
};

type Icons =
| 'PIE'
| 'LINE'
Expand All @@ -75,15 +44,6 @@ const ICON = {
YEAR_OVER_YEAR_LINE: IconVisualizationLineMulti16,
};

type Icons =
| 'PIE'
| 'LINE'
| 'GAUGE'
| 'COLUMN'
| 'PIVOT_TABLE'
| 'STACKED_COLUMN'
| 'YEAR_OVER_YEAR_LINE';

export const AccordionContent = forwardRef<
ComponentRef<typeof Accordion.Content>,
AccordionContentProps
Expand Down Expand Up @@ -166,7 +126,7 @@ export const AccordionContent = forwardRef<
<>
<div
key={item?.id}
className="text-app-grey-800 flex items-center gap-4"
className="flex items-center gap-4 text-app-grey-800"
>
<div>{<Icon />}</div>

Expand Down
3 changes: 0 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { Hydrate, QueryClientProvider } from '@tanstack/react-query';
import { queryClient } from '@/services/query-client';
import { Header } from './components/Header';

import { queryClient } from '@/services/query-client';
import { Header } from './components/Header';

const roboto = Roboto({ subsets: ['latin'], weight: ['400'] });

export default function RootLayout({
Expand Down

0 comments on commit c7f6874

Please sign in to comment.