Skip to content

Commit 8e891b0

Browse files
committed
refactor: use NcIconSvgWrapper with directional property where needed
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent def374d commit 8e891b0

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

src/components/NcActionButton/NcActionButton.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,12 @@ export default {
364364
</span>
365365

366366
<!-- right(in LTR) or left(in RTL) arrow icon when there is a sub-menu -->
367-
<ChevronRightIcon v-if="isMenu && !isRtl" :size="20" class="action-button__menu-icon" />
368-
<ChevronLeftIcon v-else-if="isMenu && isRtl" :size="20" class="action-button__menu-icon" />
369-
<CheckIcon v-else-if="isChecked === true" :size="20" class="action-button__pressed-icon" />
367+
<NcIconSvgWrapper v-if="isMenu"
368+
class="action-button__menu-icon"
369+
directional
370+
:path="mdiChevronRight" />
371+
<NcIconSvgWrapper v-else-if="isChecked" :path="mdiCheck" class="action-button__pressed-icon" />
372+
370373
<span v-else-if="isChecked === false" class="action-button__pressed-icon material-design-icon" />
371374

372375
<!-- fake slot to gather inner text -->
@@ -376,11 +379,9 @@ export default {
376379
</template>
377380

378381
<script>
379-
import CheckIcon from 'vue-material-design-icons/Check.vue'
380-
import ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'
381-
import ChevronLeftIcon from 'vue-material-design-icons/ChevronLeft.vue'
382+
import { mdiCheck, mdiChevronRight } from '@mdi/js'
382383
import ActionTextMixin from '../../mixins/actionText.js'
383-
import { isRtl } from '../../utils/rtl.ts'
384+
import NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'
384385
385386
/**
386387
* Button component to be used in Actions
@@ -389,9 +390,7 @@ export default {
389390
name: 'NcActionButton',
390391
391392
components: {
392-
CheckIcon,
393-
ChevronRightIcon,
394-
ChevronLeftIcon,
393+
NcIconSvgWrapper,
395394
},
396395
mixins: [ActionTextMixin],
397396
@@ -476,7 +475,8 @@ export default {
476475
},
477476
setup() {
478477
return {
479-
isRtl,
478+
mdiCheck,
479+
mdiChevronRight,
480480
}
481481
},
482482

src/components/NcActionTextEditable/NcActionTextEditable.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,25 @@ export default {
8282
<!-- allow the custom font to inject a ::before
8383
not possible on input[type=submit] -->
8484
<label v-show="!disabled" :for="id" class="action-text-editable__label">
85-
<ArrowLeft v-if="isRtl" :size="20" />
86-
<ArrowRight v-else :size="20" />
85+
<NcIconSvgWrapper directional :path="mdiArrowRight" />
8786
</label>
8887
</form>
8988
</span>
9089
</li>
9190
</template>
9291

9392
<script>
93+
import { mdiArrowRight } from '@mdi/js'
9494
import { useModelMigration } from '../../composables/useModelMigration.ts'
9595
import ActionTextMixin from '../../mixins/actionText.js'
9696
import GenRandomId from '../../utils/GenRandomId.js'
97-
98-
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
99-
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
100-
101-
import { isRtl } from '../../utils/rtl.ts'
97+
import NcIconSvgWrapper from '../NcIconSvgWrapper/index.js'
10298
10399
export default {
104100
name: 'NcActionTextEditable',
105101
106102
components: {
107-
ArrowLeft,
108-
ArrowRight,
103+
NcIconSvgWrapper,
109104
},
110105
111106
mixins: [ActionTextMixin],
@@ -170,7 +165,7 @@ export default {
170165
const model = useModelMigration('value', 'update:value')
171166
return {
172167
model,
173-
isRtl,
168+
mdiArrowRight,
174169
}
175170
},
176171

0 commit comments

Comments
 (0)