Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(post): utilize switch to toggle the post menu
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 10, 2022
1 parent 176ec0c commit 6486e00
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/post/post_viewer/menu.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<div class="controls relative">
<Dropdown
:is-dropdown-shown="isDropdownShown"
class="postmenu absolute top-[2em] right-0 flex flex-col"
@close="togglePostMenu(post)">
@toggle="toggleDropdown"
@resize="toggleDropdown">
<template #toggler>
<button class="material-icons">
more_vert
Expand Down Expand Up @@ -30,6 +32,7 @@ import type { PageContext } from "$/types/renderer"
import type { DeserializedPostResource } from "$/types/documents/post"
import type { DeserializedUserResource } from "$/types/documents/user"
import makeSwitch from "$@/helpers/make_switch"
import PermissionGroup from "$/permissions/post"
import {
UPDATE_PERSONAL_POST_ON_OWN_DEPARTMENT,
Expand Down Expand Up @@ -58,6 +61,11 @@ const { pageProps } = pageContext
const { userProfile } = pageProps
const {
"state": isDropdownShown,
"toggle": toggleDropdown
} = makeSwitch(false)
const poster = computed<DeserializedUserResource<"department">>(
() => props.post.poster.data as DeserializedUserResource<"department">
)
Expand Down Expand Up @@ -121,7 +129,6 @@ const mayRestorePost = computed<boolean>(() => {
return isPermitted && props.post.deletedAt !== null
})
// Post edit
function updatePost() {
emit("updatePost", props.post.id)
}
Expand Down

0 comments on commit 6486e00

Please sign in to comment.