Skip to content

Commit

Permalink
handlenett-frontend: show creator
Browse files Browse the repository at this point in the history
why? then you know who to contact if you dont understand the
mission
  • Loading branch information
maads committed Oct 23, 2024
1 parent 593a153 commit 2ef889a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions handlenett-frontend/components/Item.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<template>
<div class="groceryitem">
<label :class="{ 'complete': status }">
<input type="checkbox" :checked="status" @change="update"> {{ props.element?.name }}
</label>
<div>
<label :class="{ 'complete': status }">
<input type="checkbox" :checked="status" @change="update"> {{ props.element?.name }}
</label>
<div class="gi-creator">📝{{ createdBy }}</div>
</div>
<div class="button-group">
<button v-if="false" class="btn primary" @click="editeleement">✏️
</button>
Expand Down Expand Up @@ -35,6 +38,14 @@ const deleteeleement = () => {
emit('delete', { id: props.element.id })
}
const createdBy = computed(() => {
const fullEmail = props.element.createdBy;
const dottedName = fullEmail.split('@')[0];
const firstName = dottedName.split('.')[0];
return firstName.charAt(0).toUpperCase() + firstName.slice(1);
});
</script>
<style scoped>
.groceryitem {
Expand All @@ -46,6 +57,12 @@ const deleteeleement = () => {
font-weight: bold;
}
.gi-creator{
font-size: 0.8rem;
font-weight: 100;
padding-left: 1rem;
}
.button-group {
display: flex;
gap: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion handlenett-frontend/components/NewItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</form>
</template>
<script setup>
import { ref, defineEmits } from 'vue'
import { ref } from 'vue'
const item = ref('')
const emit = defineEmits(['changed'])
Expand Down

0 comments on commit 2ef889a

Please sign in to comment.