Skip to content

Commit

Permalink
add Collapse from @volkovlabs/components
Browse files Browse the repository at this point in the history
  • Loading branch information
vitPinchuk committed Feb 1, 2024
1 parent 5a486a6 commit 6b2e425
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 181 deletions.
45 changes: 0 additions & 45 deletions src/components/Collapse/Collapse.styles.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/components/Collapse/Collapse.test.tsx

This file was deleted.

86 changes: 0 additions & 86 deletions src/components/Collapse/Collapse.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/Collapse/index.ts

This file was deleted.

10 changes: 5 additions & 5 deletions src/components/SeriesEditor/SeriesEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, Icon, InlineField, InlineFieldRow, Input, useTheme2 } from '@grafana/ui';
import { Collapse } from '@volkovlabs/components';
import React, { useCallback, useMemo, useState } from 'react';
import {
DragDropContext,
Expand All @@ -12,7 +13,6 @@ import {
import { TEST_IDS } from '../../constants';
import { DatasetItem, SeriesItem, SeriesType } from '../../types';
import { getSeriesUniqueId, getSeriesWithNewType, reorder } from '../../utils';
import { Collapse } from '../Collapse';
import { SeriesItemEditor } from '../SeriesItemEditor';
import { getStyles } from './SeriesEditor.styles';

Expand Down Expand Up @@ -150,13 +150,15 @@ export const SeriesEditor: React.FC<Props> = ({ value, onChange, dataset }) => {
className={styles.item}
>
<Collapse
headerTestId={TEST_IDS.seriesEditor.itemHeader(item.id)}
contentTestId={TEST_IDS.seriesEditor.itemContent(item.id)}
isOpen={collapseState[item.uid]}
onToggle={() => onToggleItem(item)}
title={
<>
{item.name} [{item.id}]
</>
}
headerTestId={TEST_IDS.seriesEditor.itemHeader(item.id)}
contentTestId={TEST_IDS.seriesEditor.itemContent(item.id)}
actions={
<>
<Button
Expand All @@ -176,8 +178,6 @@ export const SeriesEditor: React.FC<Props> = ({ value, onChange, dataset }) => {
<Icon name="draggabledots" {...provided.dragHandleProps} className={styles.dragIcon} />
</>
}
isOpen={collapseState[item.uid]}
onToggle={() => onToggleItem(item)}
>
<SeriesItemEditor value={item} onChange={onChangeItem} dataset={dataset} />
</Collapse>
Expand Down

0 comments on commit 6b2e425

Please sign in to comment.