mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post-menu): add Report/Delete, reorder buttons, edit-only-for-mods, copy link 5chan.app (#1089)
* Update crypto address UI for .bso accounts * feat(post-menu): add Report/Delete, reorder buttons, edit-only-for-mods, copy link 5chan.app - Remove redundant reason field from edit menu (purged posts unreachable) - Add Report post (placeholder alert) and Delete post (mobile) to post menus - Reorder: Report, Hide, Delete, Copy x3, Image search - Mobile edit checkbox only for mods; authors use Delete in post menu - Copy direct link always uses 5chan.app domain - 10px margin-top on mod menu save button * fix(post-menu): add confirmation before delete post (Bugbot)
This commit is contained in:
@@ -36,7 +36,7 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
const { t } = useTranslation();
|
||||
const isMobile = useIsMobile();
|
||||
const resolvedPost = withResolvedCommentCommunityAddress(post);
|
||||
const { author, cid, content, deleted, locked, parentCid, pinned, postCid, reason, removed, spoiler } = resolvedPost || {};
|
||||
const { author, cid, content, deleted, locked, parentCid, pinned, postCid, removed, spoiler } = resolvedPost || {};
|
||||
const communityAddress = getCommentCommunityAddress(resolvedPost);
|
||||
const archived = isCommentArchived(resolvedPost);
|
||||
const authorDisplayName = resolvedPost?.author?.displayName;
|
||||
@@ -80,7 +80,6 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
removed: removed ?? false,
|
||||
purged: purged ?? false,
|
||||
spoiler: spoiler ?? false,
|
||||
reason,
|
||||
author: modBanExpiresAt ? { banExpiresAt: modBanExpiresAt } : undefined,
|
||||
}
|
||||
: undefined,
|
||||
@@ -101,7 +100,6 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
deleted,
|
||||
locked,
|
||||
pinned,
|
||||
reason,
|
||||
removed,
|
||||
purged,
|
||||
spoiler,
|
||||
@@ -118,7 +116,6 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
communityAddress,
|
||||
content: publishCommentEditOptions.content,
|
||||
deleted: publishCommentEditOptions.deleted,
|
||||
reason: publishCommentEditOptions.reason,
|
||||
spoiler: publishCommentEditOptions.spoiler,
|
||||
onChallenge,
|
||||
onChallengeVerification: alertChallengeVerificationFailed,
|
||||
@@ -150,7 +147,6 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
removed: publishCommentEditOptions.commentModeration?.removed,
|
||||
purged: publishCommentEditOptions.commentModeration?.purged,
|
||||
spoiler: publishCommentEditOptions.commentModeration?.spoiler,
|
||||
reason: publishCommentEditOptions.reason,
|
||||
author: publishCommentEditOptions.commentModeration?.author,
|
||||
},
|
||||
author: account?.author,
|
||||
@@ -436,18 +432,6 @@ const EditMenu = ({ post }: { post: Comment }) => {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className={`${styles.menuItem} ${styles.menuReason}`}>
|
||||
{capitalize(t('reason'))}? ({t('optional')})
|
||||
<input
|
||||
type='text'
|
||||
value={publishCommentEditOptions.reason || ''}
|
||||
onChange={(e) => {
|
||||
const newReason = e.target.value;
|
||||
setPublishCommentEditOptions((state) => ({ ...state, reason: newReason }));
|
||||
}}
|
||||
size={14}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.bottom}>
|
||||
<button className={isMobile ? 'button' : ''} onClick={_publishCommentEdit} disabled={!canSave}>
|
||||
{t('save')}
|
||||
|
||||
Reference in New Issue
Block a user