Skip to content

Commit

Permalink
feat(ui): use material-icons
Browse files Browse the repository at this point in the history
`material-symbols-outlined` was specifically used.
  • Loading branch information
lemredd committed Dec 22, 2022
1 parent 7f2ef2d commit b08c8da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/CalculatorContainer/CorrectionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,28 @@ interface CustomEvents {
(event: "clearEntryScreen"): void
}
const emit = defineEmits<CustomEvents>()
const mayOneDigitOnly = computed(() => props.value === "")
const mayClearOneDigitOnly = computed(() => props.value === "")
const mayClearEntryScreenOnly = computed(() => props.value === "CE")
function clearScreens() {
if (mayClearEntryScreenOnly.value) emit("clearEntryScreen")
if (mayOneDigitOnly.value) emit("clearOneDigit")
if (mayClearOneDigitOnly.value) emit("clearOneDigit")
else emit("clearAllScreens")
}
</script>

<template>
<button class="correction-button" @click="clearScreens">
{{ props.value }}
<span v-if="mayClearOneDigitOnly" class="material-symbols-outlined one-digit">
backspace
</span>
<span v-else>
{{ props.value }}
</span>
</button>
</template>


<style scoped lang="scss">
@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0";
</style>

0 comments on commit b08c8da

Please sign in to comment.