Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ed01528f

Přidáno uživatelem Dominik Poch před asi 2 roky(ů)

Implemented tag panel

Implemented tag panel and all its items

Zobrazit rozdíly:

webapp/components/annotation/TagPanel.tsx
1
import { CategoryItem } from './CategoryItem';
2
import { TagCategoryInfo } from '../../api';
3
import { Stack } from 'react-bootstrap';
4

  
1 5
/**
2 6
 * Creates a panel in the annotation screen that contains a list of tag.
3 7
 * @returns Panel with a list of tags.
4 8
 */
5 9
export function TagPanel() {
10
    const tags: TagCategoryInfo[] = [
11
        {
12
            name: 'kategorie 1',
13
            color: '#FF0000',
14
            tags: [
15
                {
16
                    name: 'tag 1',
17
                    color: '#CD5C5C',
18
                    subTags: [{ name: 'subTag 1' }, { name: 'subTag 2' }],
19
                },
20
                { name: 'tag 2', color: '#F08080' },
21
            ],
22
        },
23
        {
24
            name: 'kategorie 2',
25
            color: '#0000FF',
26
            tags: [{ name: 'tag 3', color: '#3498DB' }],
27
        },
28
    ];
29

  
6 30
    return (
7 31
        <div>
8
            <p>Panel with a list of tags</p>
32
            <Stack>
33
                {tags.map((category, index) => (
34
                    <CategoryItem category={category} key={index} />
35
                ))}
36
            </Stack>
9 37
        </div>
10 38
    );
11 39
}

Také k dispozici: Unified diff