diff --git a/electron/main.js b/electron/main.js index 14832ca5..6f13cd65 100644 --- a/electron/main.js +++ b/electron/main.js @@ -261,12 +261,12 @@ const createMainWindow = () => { } const appMenuBack = new MenuItem({ - label: '←', + label: 'Previous', enabled: mainWindow?.webContents?.canGoBack(), click: () => mainWindow?.webContents?.goBack(), }); const appMenuForward = new MenuItem({ - label: '→', + label: 'Next', enabled: mainWindow?.webContents?.canGoForward(), click: () => mainWindow?.webContents?.goForward(), }); diff --git a/public/assets/buttons/delete-button.png b/public/assets/buttons/delete-button.png new file mode 100644 index 00000000..aadd17da Binary files /dev/null and b/public/assets/buttons/delete-button.png differ diff --git a/public/index.html b/public/index.html index 38309a4a..20221a71 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ - + { const SubplebbitsHeaderTabs = () => { const { t } = useTranslation(); + const location = useLocation(); + const isInSubplebbitsMineSubscriberView = isSubplebbitsMineSubscriberView(location.pathname); + const isInSubplebbitsMineModeratorView = isSubplebbitsMineModeratorView(location.pathname); + const isInSubplebbitsView = isSubplebbitsView(location.pathname) && !isInSubplebbitsMineSubscriberView && !isInSubplebbitsMineModeratorView; + const isInSubplebbitsMineView = isSubplebbitsMineView(location.pathname); return ( <>
  • - e.preventDefault()}> + approved
  • @@ -210,7 +218,10 @@ const SubplebbitsHeaderTabs = () => {
  • - e.preventDefault()}> + {t('my_communities')}
  • diff --git a/src/components/post/comment-tools/comment-tools.tsx b/src/components/post/comment-tools/comment-tools.tsx index f468c855..71165c5f 100644 --- a/src/components/post/comment-tools/comment-tools.tsx +++ b/src/components/post/comment-tools/comment-tools.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Author, useAccount, useComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import styles from './comment-tools.module.css'; import HideMenu from './hide-menu'; -import ModTools from './mod-menu'; +import ModMenu from './mod-menu'; import ShareMenu from './share-menu'; import { FailedLabel, PendingLabel, SpoilerLabel } from '../label'; import { isInboxView } from '../../../lib/utils/view-utils'; @@ -39,16 +39,16 @@ const PostTools = ({ author, cid, hasLabel, index, isMod, subplebbitAddress, rep {t('save')} +
  • + {t('crosspost')} +
  • {isMod ? ( - + ) : (
  • {t('report')}
  • )} -
  • - {t('crosspost')} -
  • ); }; @@ -66,16 +66,16 @@ const ReplyTools = ({ author, cid, hasLabel, index, isMod, showReplyForm, subple {t('save')} +
  • + cid && showReplyForm?.()}>{t('reply_reply')} +
  • {isMod ? ( - + ) : (
  • {t('report')}
  • )} -
  • - cid && showReplyForm?.()}>{t('reply_reply')} -
  • ); }; @@ -104,6 +104,13 @@ const SingleReplyTools = ({ author, cid, hasLabel, index, isMod, parentCid, show
  • cid && showReplyForm?.()}>{t('reply_reply')}
  • + {isMod ? ( + + ) : ( +
  • + {t('report')} +
  • + )} ); }; diff --git a/src/components/post/comment-tools/mod-menu/mod-menu.tsx b/src/components/post/comment-tools/mod-menu/mod-menu.tsx index 443dcb5e..e95b579b 100644 --- a/src/components/post/comment-tools/mod-menu/mod-menu.tsx +++ b/src/components/post/comment-tools/mod-menu/mod-menu.tsx @@ -8,15 +8,15 @@ import challengesStore from '../../../../hooks/use-challenges'; const { addChallenge } = challengesStore.getState(); -type ModToolsProps = { +type ModMenuProps = { cid: string; }; -const ModTools = ({ cid }: ModToolsProps) => { +const ModMenu = ({ cid }: ModMenuProps) => { const { t } = useTranslation(); const post = useComment({ commentCid: cid }); const isReply = post?.parentCid; - const [isModToolsOpen, setIsModToolsOpen] = useState(false); + const [isModMenuOpen, setIsModMenuOpen] = useState(false); const defaultPublishOptions: PublishCommentEditOptions = { removed: post?.removed, @@ -39,9 +39,9 @@ const ModTools = ({ cid }: ModToolsProps) => { // close the modal after publishing useEffect(() => { if (state && state !== 'failed' && state !== 'initializing' && state !== 'ready') { - setIsModToolsOpen(false); + setIsModMenuOpen(false); } - }, [state, setIsModToolsOpen]); + }, [state, setIsModMenuOpen]); const onCheckbox = (e: React.ChangeEvent) => setPublishCommentEditOptions((state) => ({ ...state, [e.target.id]: e.target.checked })); @@ -50,8 +50,8 @@ const ModTools = ({ cid }: ModToolsProps) => { const { refs, floatingStyles, context } = useFloating({ placement: 'bottom-start', - open: isModToolsOpen, - onOpenChange: setIsModToolsOpen, + open: isModMenuOpen, + onOpenChange: setIsModMenuOpen, middleware: [offset(2), flip({ fallbackAxisSideDirection: 'end' }), shift()], whileElementsMounted: autoUpdate, }); @@ -67,12 +67,12 @@ const ModTools = ({ cid }: ModToolsProps) => { return ( <>
  • - setIsModToolsOpen(!isModToolsOpen)}>{t('moderation')} + setIsModMenuOpen(!isModMenuOpen)}>{t('moderation')}
  • - {isModToolsOpen && ( + {isModMenuOpen && (
    -
    +