Skip to content

Commit cbc1c30

Browse files
committed
Restyle text select to more resemble an interactive UI component
1 parent 4cdd741 commit cbc1c30

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Tekst-Web/i18n/ui/deDE.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ common:
3535
expand: Ausklappen
3636
collapse: Einklappen
3737
showAttachments: Angehängte Inhalte anzeigen
38-
textSelect: Wählen Sie den Text, mit dem Sie arbeiten möchten
38+
textSelect: Arbeitstext auswählen
3939
info: Info
4040
information: Information
4141
warning: Warnung

Tekst-Web/i18n/ui/enUS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ common:
3535
expand: Expand
3636
collapse: Collapse
3737
showAttachments: Show attached contents
38-
textSelect: Select the text you want to work with
38+
textSelect: Select working text
3939
info: Info
4040
information: Information
4141
warning: Warning

Tekst-Web/src/components/navigation/TextSelect.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { TextRead } from '@/api';
33
import TextSelectOption from '@/components/navigation/TextSelectOption.vue';
44
import { ExpandArrowDownIcon } from '@/icons';
55
import { useBrowseStore, useStateStore } from '@/stores';
6-
import { NButton, NDropdown, NFlex, NIcon, useThemeVars } from 'naive-ui';
6+
import { NButton, NDropdown, NIcon, useThemeVars } from 'naive-ui';
77
import { computed, h, ref } from 'vue';
88
import { useRouter } from 'vue-router';
99
@@ -64,19 +64,19 @@ function handleSelect(text: TextRead) {
6464
placement="bottom-start"
6565
>
6666
<n-button
67-
text
68-
icon-placement="right"
67+
ghost
6968
:color="themeVars.baseColor"
69+
icon-placement="right"
7070
:focusable="false"
7171
:keyboard="false"
7272
:title="$t('common.textSelect')"
7373
class="text-select-btn"
7474
:style="{ cursor: !disabled ? 'pointer' : 'default' }"
7575
>
76-
<n-flex align="center" :wrap="false" style="max-width: 100%">
77-
<span class="text-title ellipsis text-large">{{ state.text?.title || '???' }}</span>
78-
<n-icon v-if="!disabled" :component="ExpandArrowDownIcon" style="flex-shrink: 0" />
79-
</n-flex>
76+
<template v-if="!disabled" #icon>
77+
<n-icon :component="ExpandArrowDownIcon" />
78+
</template>
79+
<div class="text-title ellipsis text-large">{{ state.text?.title || '???' }}</div>
8080
</n-button>
8181
</n-dropdown>
8282
</template>
@@ -87,6 +87,10 @@ function handleSelect(text: TextRead) {
8787
justify-content: flex-start;
8888
}
8989
90+
.text-select-btn.n-button--ghost:hover {
91+
background-color: #fff2;
92+
}
93+
9094
.text-title {
9195
line-height: 150%;
9296
max-width: 100%;

0 commit comments

Comments
 (0)