Skip to content

Commit 667232d

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

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
@@ -355,9 +355,12 @@ export default {
355355
<span v-else class="action-button__text">{{ text }}</span>
356356

357357
<!-- right(in LTR) or left(in RTL) arrow icon when there is a sub-menu -->
358-
<ChevronRightIcon v-if="isMenu && !isRtl" :size="20" class="action-button__menu-icon" />
359-
<ChevronLeftIcon v-else-if="isMenu && isRtl" :size="20" class="action-button__menu-icon" />
360-
<CheckIcon v-else-if="isChecked === true" :size="20" class="action-button__pressed-icon" />
358+
<NcIconSvgWrapper v-if="isMenu"
359+
class="action-button__menu-icon"
360+
directional
361+
:path="mdiChevronRight" />
362+
<NcIconSvgWrapper v-else-if="isChecked" :path="mdiCheck" class="action-button__pressed-icon" />
363+
361364
<span v-else-if="isChecked === false" class="action-button__pressed-icon material-design-icon" />
362365

363366
<!-- fake slot to gather inner text -->
@@ -367,12 +370,10 @@ export default {
367370
</template>
368371

369372
<script>
370-
import CheckIcon from 'vue-material-design-icons/Check.vue'
371-
import ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'
372-
import ChevronLeftIcon from 'vue-material-design-icons/ChevronLeft.vue'
373-
import ActionTextMixin from '../../mixins/actionText.js'
374-
import { isRtl } from '../../utils/rtl.ts'
373+
import { mdiCheck, mdiChevronRight } from '@mdi/js'
375374
import { NC_ACTIONS_IS_SEMANTIC_MENU } from '../NcActions/useNcActions.ts'
375+
import ActionTextMixin from '../../mixins/actionText.js'
376+
import NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'
376377
377378
/**
378379
* Button component to be used in Actions
@@ -381,9 +382,7 @@ export default {
381382
name: 'NcActionButton',
382383
383384
components: {
384-
CheckIcon,
385-
ChevronRightIcon,
386-
ChevronLeftIcon,
385+
NcIconSvgWrapper,
387386
},
388387
389388
mixins: [ActionTextMixin],
@@ -464,7 +463,8 @@ export default {
464463
465464
setup() {
466465
return {
467-
isRtl,
466+
mdiCheck,
467+
mdiChevronRight,
468468
}
469469
},
470470

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="mdiArrowLeft" />
7978
</label>
8079
</form>
8180
</span>
8281
</li>
8382
</template>
8483

8584
<script>
86-
import ActionTextMixin from '../../mixins/actionText.js'
85+
import { mdiArrowLeft } 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+
mdiArrowLeft,
138134
}
139135
},
140136

0 commit comments

Comments
 (0)