Skip to content

Commit b8d3a49

Browse files
authored
Merge pull request #6767 from nextcloud-libraries/chore/rtl-icon
refactor: use `NcIconSvgWrapper` with `directional` property where needed
2 parents d247581 + 653d05e commit b8d3a49

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

src/components/NcActionButton/NcActionButton.vue

Lines changed: 12 additions & 12 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,12 +379,10 @@ 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 ActionTextMixin from '../../mixins/actionText.js'
383-
import { isRtl } from '../../utils/rtl.ts'
382+
import { mdiCheck, mdiChevronRight } from '@mdi/js'
384383
import { NC_ACTIONS_IS_SEMANTIC_MENU } from '../NcActions/useNcActions.ts'
384+
import ActionTextMixin from '../../mixins/actionText.js'
385+
import NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'
385386
386387
/**
387388
* Button component to be used in Actions
@@ -390,9 +391,7 @@ export default {
390391
name: 'NcActionButton',
391392
392393
components: {
393-
CheckIcon,
394-
ChevronRightIcon,
395-
ChevronLeftIcon,
394+
NcIconSvgWrapper,
396395
},
397396
398397
mixins: [ActionTextMixin],
@@ -471,7 +470,8 @@ export default {
471470
472471
setup() {
473472
return {
474-
isRtl,
473+
mdiCheck,
474+
mdiChevronRight,
475475
}
476476
},
477477

src/components/NcActionTextEditable/NcActionTextEditable.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,25 @@ export default {
7474
<!-- allow the custom font to inject a ::before
7575
not possible on input[type=submit] -->
7676
<label v-show="!disabled" :for="id" class="action-text-editable__label">
77-
<ArrowLeft v-if="isRtl" :size="20" />
78-
<ArrowRight v-else :size="20" />
77+
<NcIconSvgWrapper directional :path="mdiArrowRight" />
7978
</label>
8079
</form>
8180
</span>
8281
</li>
8382
</template>
8483

8584
<script>
86-
import ActionTextMixin from '../../mixins/actionText.js'
85+
import { mdiArrowRight } from '@mdi/js'
8786
import { createElementId } from '../../utils/createElementId.ts'
8887
89-
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
90-
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
91-
92-
import { isRtl } from '../../utils/rtl.ts'
88+
import ActionTextMixin from '../../mixins/actionText.js'
89+
import NcIconSvgWrapper from '../NcIconSvgWrapper/index.js'
9390
9491
export default {
9592
name: 'NcActionTextEditable',
9693
9794
components: {
98-
ArrowLeft,
99-
ArrowRight,
95+
NcIconSvgWrapper,
10096
},
10197
10298
mixins: [ActionTextMixin],
@@ -134,7 +130,7 @@ export default {
134130
135131
setup() {
136132
return {
137-
isRtl,
133+
mdiArrowRight,
138134
}
139135
},
140136

0 commit comments

Comments
 (0)