Projekt

Obecné

Profil

« Předchozí | Další » 

Revize a547b12c

Přidáno uživatelem Lukáš Vlček před více než 2 roky(ů)

Occurrence - like canceling

Zobrazit rozdíly:

webapp/components/annotation/AnnotationOccurrenceItem.tsx
3 3
import { ChangeEvent, useContext } from 'react';
4 4
import 'antd/dist/antd.css';
5 5
import { Button, Input, Select } from 'antd';
6
import { DeleteOutlined, EyeOutlined, LikeOutlined } from '@ant-design/icons';
6
import {
7
    DeleteOutlined,
8
    DislikeOutlined,
9
    EyeOutlined,
10
    LikeOutlined,
11
} from '@ant-design/icons';
7 12
import { AnnotationContext } from '../../contexts/AnnotationContext';
8 13
import { ETagSentiment, TagInstanceInfo } from '../../api';
9 14
import { getNameTruncated, getTextMaxLength } from '../../utils/strings';
......
153 158
                    />
154 159
                    {isFinal && (
155 160
                        <Button
156
                            icon={<LikeOutlined />}
157
                            title={'Označit jako správné řešení'}
161
                            icon={
162
                                props.occurrence.isFinal ? (
163
                                    <DislikeOutlined />
164
                                ) : (
165
                                    <LikeOutlined />
166
                                )
167
                            }
168
                            title={
169
                                props.occurrence.isFinal
170
                                    ? 'ZRUŠIT označení správného řešení'
171
                                    : 'Označit jako správné řešení'
172
                            }
158 173
                            onClick={() => {
159
                                ShowConfirm(() => {
160
                                    makeOccurrenceFinal(props.occurrence);
161
                                }, 'označit toto řešení jako správné');
174
                                ShowConfirm(
175
                                    () => {
176
                                        makeOccurrenceFinal(
177
                                            props.occurrence,
178
                                            !props.occurrence.isFinal
179
                                        );
180
                                    },
181
                                    props.occurrence.isFinal
182
                                        ? 'ZRUŠIT označené správného řešení'
183
                                        : 'označit toto řešení jako správné'
184
                                );
162 185
                            }}
163 186
                            className={'mt-1'}
164 187
                        />

Také k dispozici: Unified diff