-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update marking things as read or unread to reflect in the bell icon
- Loading branch information
1 parent
05495dd
commit 0afaea1
Showing
22 changed files
with
265 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,76 @@ | ||
<template> | ||
<div class="w-full flex flex-col"> | ||
<div class="w-full flex flex-col divide-y divide-stone-700 dark:divide-stone-800"> | ||
<input | ||
:value="modelValue.name" | ||
@input="$emit('update:modelValue', { | ||
...modelValue, | ||
name: $event.target.value | ||
})" | ||
class="bg-transparent w-full rounded-t-md text-xs leading-loose tracking-wide font-bold py-0 px-4" placeholder="text" type="text" | ||
:disabled="!editableLabel" | ||
:class="inputClasses(!editableLabel)" | ||
class="rounded-t-md text-xs leading-loose tracking-wide font-bold py-0 px-4" placeholder="text" type="text" | ||
/> | ||
<label | ||
class="flex dark:bg-stone-600 dark:placeholder-stone-300 rounded-b-md h-10" | ||
v-if="type !== 'object'" | ||
:class="[type === 'checkbox' ? 'pl-4 pt-4': 'p-0']" | ||
> | ||
<input | ||
class="py-2 px-3 block shadow-sm sm:text-sm dark:bg-stone-600 dark:placeholder-stone-300 rounded-b-md" | ||
:class="[type !== 'checkbox' ? 'w-full': 'bg-stone-50 border-stone-50 dark:border-stone-600 border p-1']" | ||
class="py-2 px-3 block shadow-sm sm:text-sm rounded-b-md" | ||
:class="inputClasses(disabledInput)" | ||
:value="modelValue.value" | ||
@input="$emit('update:modelValue', { | ||
...modelValue, | ||
value: $event.target.value | ||
})" | ||
:type="type" | ||
:disabled="disabledInput" | ||
/> | ||
|
||
</label> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['modelValue', 'type', 'autofocus'], | ||
emits: ['update:modelValue'], | ||
} | ||
<script setup> | ||
import { computed } from 'vue'; | ||
const { | ||
modelValue, | ||
type, | ||
autofocus, | ||
disabledInput, | ||
editableLabel | ||
} = defineProps({ | ||
modelValue: Object, | ||
type: String, | ||
autofocus: Boolean, | ||
disabledInput: { | ||
type: Boolean, | ||
default: () => true, | ||
}, | ||
editableLabel: { | ||
type: Boolean, | ||
default: () => false, | ||
} | ||
}) | ||
// emits: ['update:modelValue'], | ||
const inputClasses = (disabled) => { | ||
let baseClasses = []; | ||
if (type !== 'checkbox') { | ||
baseClasses.push('w-full'); | ||
} | ||
baseClasses.push('border', 'p-1'); | ||
console.log({disabled}) | ||
if (disabled) { | ||
baseClasses.push('bg-stone-50', 'border-stone-50', 'dark:border-stone-900/50', 'dark:bg-stone-700/50', 'dark:placeholder-stone-300') | ||
} else { | ||
baseClasses.push('bg-stone-50', 'border-stone-50', 'dark:border-stone-700', 'dark:bg-stone-700', 'dark:placeholder-stone-300') | ||
} | ||
return baseClasses; | ||
}; | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.