Skip to content

Commit

Permalink
fix(Modal): remove story with combobox (#799)
Browse files Browse the repository at this point in the history
issue -  #692
  • Loading branch information
azhadanov authored Jan 29, 2021
1 parent 2b87ce7 commit 6aa71b9
Showing 1 changed file with 2 additions and 64 deletions.
66 changes: 2 additions & 64 deletions src/components/Modal/__stories__/Modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import './Modal.stories.css';

import React, { useRef, useState } from 'react';
import React from 'react';
import { boolean, select } from '@storybook/addon-knobs';

import { cn } from '../../../utils/bem';
import { createMetadata, createStory } from '../../../utils/storybook';
import { createMetadata } from '../../../utils/storybook';
import { Button } from '../../Button/Button';
import { Combobox } from '../../Combobox/Combobox';
import { Text } from '../../Text/Text';
import { Modal } from '../Modal';

Expand All @@ -31,38 +30,6 @@ const defaultKnobs = () => ({
position: select('position', ['center', 'top'], 'center'),
});

const items = [
{ label: 'Neptunium', value: 'Neptunium' },
{ label: 'Plutonium', value: 'Plutonium' },
{ label: 'Americium', value: 'Americium' },
{ label: 'Curium', value: 'Curium' },
{ label: 'Berkelium', value: 'Berkelium' },
{
label: 'Californium Berkelium Curium Plutonium',
value: 'Californium Berkelium Curium Plutonium',
},
{ label: 'Einsteinium', value: 'Einsteinium' },
{ label: 'Fermium', value: 'Fermium' },
{ label: 'Mendelevium', value: 'Mendelevium' },
{ label: 'Nobelium', value: 'Nobelium' },
{ label: 'Lawrencium', value: 'Lawrencium' },
{ label: 'Rutherfordium', value: 'Rutherfordium' },
{ label: 'Dubnium', value: 'Dubnium' },
{ label: 'Seaborgium', value: 'Seaborgium' },
{ label: 'Bohrium', value: 'Bohrium' },
{ label: 'Hassium', value: 'Hassium' },
{ label: 'Meitnerium', value: 'Meitnerium' },
{ label: 'Darmstadtium', value: 'Darmstadtium' },
{ label: 'Roentgenium', value: 'Roentgenium' },
{ label: 'Copernicium', value: 'Copernicium' },
{ label: 'Nihonium', value: 'Nihonium' },
{ label: 'Flerovium', value: 'Flerovium' },
{ label: 'Moscovium', value: 'Moscovium' },
{ label: 'Livermorium', value: 'Livermorium' },
{ label: 'Tennessine', value: 'Tennessine' },
{ label: 'Oganesson', value: 'Oganesson' },
];

export function Playground(props: {
children: React.ReactNode;
dropdownRef: React.RefObject<HTMLElement>[];
Expand Down Expand Up @@ -117,35 +84,6 @@ export function Playground(props: {
);
}

export const WithCreateStory = createStory(
() => {
const getItemLabel = (option: SelectOption): string => option.label;
const dropdownRef = useRef<HTMLDivElement | null>(null);
const [value, setValue] = useState<Option | null | undefined>();

return (
<Playground dropdownRef={[dropdownRef]}>
<Text as="p" size="s" view="secondary" className={cnModalStories('title')}>
Заголовок модалки
</Text>
<div style={{ padding: 20 }}>
<Combobox
id="example"
options={items}
value={value}
onChange={setValue}
getOptionLabel={getItemLabel}
dropdownRef={dropdownRef}
/>
</div>
</Playground>
);
},
{
name: 'c combobox',
},
);

export default createMetadata({
title: 'Компоненты|/Modal',
id: 'components/Modal',
Expand Down

0 comments on commit 6aa71b9

Please sign in to comment.