Skip to content

Commit

Permalink
Merge pull request #352 from dappforce/hide/grill
Browse files Browse the repository at this point in the history
Hide post preview from grill admin
  • Loading branch information
olehmell authored Mar 12, 2024
2 parents a8fd2d7 + b92cfb8 commit b12ea26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/posts/view-post/PostPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export type PreviewProps = BarePreviewProps & {
showPinnedIcon?: boolean
}

// grill admin account and grill memes admin
const HIDE_PREVIEW_FROM_ACCOUNT = [
'3rPYmfYVHG7NtuGDivDNZdMMRHgrwtVuswY9TWUaHQCU8tAo',
'3oGjkULuNKRqi513BbohWiSgA2oKMrbSnPrcddpXYC4mtW1G',
]
export function PostPreview(props: PreviewProps) {
const { postDetails, space: externalSpace, showPinnedIcon } = props
const {
Expand All @@ -35,8 +40,9 @@ export function PostPreview(props: PreviewProps) {
const { isSharedPost } = post
const space = externalSpace || globalSpace
const isUnlisted = useIsUnlistedPost({ post, space: space?.struct })
const isHiddenPreview = HIDE_PREVIEW_FROM_ACCOUNT.includes(post.ownerId)

if (isUnlisted) return null
if (isUnlisted || isHiddenPreview) return null

const postContent = postDetails.post.content
const isEmptyContent = !isSharedPost && !postContent?.title && !postContent?.body
Expand Down

0 comments on commit b12ea26

Please sign in to comment.