implemented mode change

This commit is contained in:
2024-03-25 23:23:37 +01:00
parent 45a4b58f26
commit 3f88f6b821
71 changed files with 3020 additions and 1006 deletions

View File

@ -23,12 +23,40 @@
</table>
</section>
</template>
<script setup>
import { ref } from 'vue';
const darkMode = ref(true)
<script setup>
import { ref, onMounted, watch } from 'vue';
import { useStore } from 'vuex';
import { computed } from 'vue';
const store = useStore();
const modeChanged = computed(() => store.state.updateDarkMode);
const darkMode = ref('')
const getSession = async () => {
const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
if (loggedInUserDarkModeBool == 1) {
darkMode.value = true;
} else {
darkMode.value = false;
}
}
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
} else {
return undefined
}
}
watch(modeChanged, getSession)
onMounted(async () => {
await getSession();
});
</script>
<script>
@ -36,8 +64,8 @@ export default {
name: "CustomerTable",
};
</script>
<style scoped>
.data {
display: flex;
@ -94,7 +122,8 @@ export default {
border-top: 0.0625rem solid #8e8e8e;
}
th, td {
th,
td {
height: 1.875rem;
text-align: left;
padding: 0;
@ -102,11 +131,13 @@ th, td {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
.th-darkmode, .td-darkmode {
.th-darkmode,
.td-darkmode {
color: #ffffff;
}
.th-lightmode, .td-lightmode {
.th-lightmode,
.td-lightmode {
color: #000000;
}
@ -128,4 +159,5 @@ th {
.Name {
width: 60%;
}</style>
}
</style>