From 1101305ffb72bacd68698bfbe6e961953a9043de Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 20 Aug 2022 13:02:27 -0400 Subject: Add ui for note editing --- src/components/user_note/user_note.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/user_note/user_note.js (limited to 'src/components/user_note/user_note.js') diff --git a/src/components/user_note/user_note.js b/src/components/user_note/user_note.js new file mode 100644 index 00000000..6a479800 --- /dev/null +++ b/src/components/user_note/user_note.js @@ -0,0 +1,31 @@ +const UserNote = { + props: { + user: Object, + relationship: Object + }, + data () { + return { + localNote: '', + editing: false + } + }, + computed: { + shouldShow () { + return this.relationship.note || this.editing + } + }, + methods: { + startEditing () { + this.localNote = this.relationship.note + this.editing = true + }, + cancelEditing () { + this.editing = false + }, + finalizeEditing () { + this.editing = false + } + } +} + +export default UserNote -- cgit v1.2.3-70-g09d2