mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
cleanup and partial ITag
This commit is contained in:
parent
17f58daa67
commit
cb2f784ed2
3 changed files with 9 additions and 15 deletions
|
@ -4,14 +4,14 @@ import { ITag } from '~/redux/types';
|
|||
|
||||
import classNames = require('classnames');
|
||||
|
||||
const getTagFeature = (tag: ITag) => {
|
||||
const getTagFeature = (tag: Partial<ITag>) => {
|
||||
if (tag.title.substr(0, 1) === '/') return 'green';
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
interface IProps {
|
||||
tag: ITag;
|
||||
tag: Partial<ITag>;
|
||||
|
||||
is_hoverable?: boolean;
|
||||
onInput?: ChangeEventHandler<HTMLInputElement>;
|
||||
|
|
|
@ -9,16 +9,12 @@ import React, {
|
|||
useRef,
|
||||
} from 'react';
|
||||
import { TagField } from '~/components/containers/TagField';
|
||||
import { ITag, INode } from '~/redux/types';
|
||||
import { ITag } from '~/redux/types';
|
||||
import { Tag } from '~/components/node/Tag';
|
||||
import uniq from 'ramda/es/uniq';
|
||||
import { setTimeout } from 'timers';
|
||||
import length from 'ramda/es/length';
|
||||
import isEmpty from 'ramda/es/isEmpty';
|
||||
import symmetricDifference from 'ramda/es/symmetricDifference';
|
||||
|
||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||
tags: ITag[];
|
||||
tags: Partial<ITag>[];
|
||||
is_editable?: boolean;
|
||||
onTagsChange?: (tags: string[]) => void;
|
||||
};
|
||||
|
|
|
@ -19,9 +19,7 @@ const EditorExample: FC<IProps> = () => (
|
|||
<Card className={styles.wrap} seamless>
|
||||
<Group horizontal className={styles.group} seamless>
|
||||
<div className={styles.editor}>
|
||||
<Panel
|
||||
className={classNames(styles.editor_panel, styles.editor_image_panel)}
|
||||
>
|
||||
<Panel className={classNames(styles.editor_panel, styles.editor_image_panel)}>
|
||||
<Scroll>
|
||||
<CellGrid className={styles.editor_image_container} size={200}>
|
||||
<div className={styles.editor_image} />
|
||||
|
@ -48,11 +46,11 @@ const EditorExample: FC<IProps> = () => (
|
|||
|
||||
<Tags
|
||||
tags={[
|
||||
{ title: 'Избранный', feature: 'red' },
|
||||
{ title: 'Плейлист', feature: 'green' },
|
||||
{ title: 'Избранный' },
|
||||
{ title: 'Плейлист' },
|
||||
{ title: 'Просто' },
|
||||
{ title: '+ фото', feature: 'black' },
|
||||
{ title: '+ с музыкой', feature: 'black' }
|
||||
{ title: '+ фото' },
|
||||
{ title: '+ с музыкой' },
|
||||
]}
|
||||
/>
|
||||
</Group>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue