fix(report): available only to logged in users #194
@ -35,6 +35,7 @@ export const BlogPage = () => {
|
|||||||
const isAdmin =
|
const isAdmin =
|
||||||
userState.user?.npub &&
|
userState.user?.npub &&
|
||||||
userState.user.npub === import.meta.env.VITE_REPORTING_NPUB
|
userState.user.npub === import.meta.env.VITE_REPORTING_NPUB
|
||||||
|
const isLoggedIn = userState.auth && userState.user?.pubkey !== 'undefined'
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
const [commentCount, setCommentCount] = useState(0)
|
const [commentCount, setCommentCount] = useState(0)
|
||||||
|
|
||||||
@ -172,6 +173,7 @@ export const BlogPage = () => {
|
|||||||
Share
|
Share
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{isLoggedIn && (
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
id='reportPost'
|
id='reportPost'
|
||||||
@ -189,6 +191,7 @@ export const BlogPage = () => {
|
|||||||
</svg>
|
</svg>
|
||||||
Report
|
Report
|
||||||
</a>
|
</a>
|
||||||
|
)}
|
||||||
|
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
|
@ -194,6 +194,7 @@ const Game = () => {
|
|||||||
const { mod, isAddedToNSFW, isBlocked, isRepost } =
|
const { mod, isAddedToNSFW, isBlocked, isRepost } =
|
||||||
useLoaderData() as ModPageLoaderResult
|
useLoaderData() as ModPageLoaderResult
|
||||||
const userState = useAppSelector((state) => state.user)
|
const userState = useAppSelector((state) => state.user)
|
||||||
|
const isLoggedIn = userState.auth && userState.user?.pubkey !== 'undefined'
|
||||||
const [showReportPopUp, setShowReportPopUp] = useState<number | undefined>()
|
const [showReportPopUp, setShowReportPopUp] = useState<number | undefined>()
|
||||||
|
|
||||||
useBodyScrollDisable(!!showReportPopUp)
|
useBodyScrollDisable(!!showReportPopUp)
|
||||||
@ -336,6 +337,7 @@ const Game = () => {
|
|||||||
</svg>
|
</svg>
|
||||||
Share
|
Share
|
||||||
</a>
|
</a>
|
||||||
|
{isLoggedIn && (
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
id='reportPost'
|
id='reportPost'
|
||||||
@ -355,6 +357,7 @@ const Game = () => {
|
|||||||
</svg>
|
</svg>
|
||||||
Report
|
Report
|
||||||
</a>
|
</a>
|
||||||
|
)}
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
onClick={handleBlock}
|
onClick={handleBlock}
|
||||||
|
@ -59,6 +59,7 @@ export const ProfilePage = () => {
|
|||||||
const displayName =
|
const displayName =
|
||||||
profile?.displayName || profile?.name || '[name not set up]'
|
profile?.displayName || profile?.name || '[name not set up]'
|
||||||
const [showReportPopUp, setShowReportPopUp] = useState(false)
|
const [showReportPopUp, setShowReportPopUp] = useState(false)
|
||||||
|
const isLoggedIn = userState.auth && userState.user?.pubkey !== 'undefined'
|
||||||
const isOwnProfile =
|
const isOwnProfile =
|
||||||
userState.auth &&
|
userState.auth &&
|
||||||
userState.user?.pubkey &&
|
userState.user?.pubkey &&
|
||||||
@ -376,6 +377,7 @@ export const ProfilePage = () => {
|
|||||||
</a>
|
</a>
|
||||||
{!isOwnProfile && (
|
{!isOwnProfile && (
|
||||||
<>
|
<>
|
||||||
|
{isLoggedIn && (
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
id='reportUser'
|
id='reportUser'
|
||||||
@ -393,6 +395,7 @@ export const ProfilePage = () => {
|
|||||||
</svg>
|
</svg>
|
||||||
Report
|
Report
|
||||||
</a>
|
</a>
|
||||||
|
)}
|
||||||
<a
|
<a
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
onClick={isBlocked ? handleUnblock : handleBlock}
|
onClick={isBlocked ? handleUnblock : handleBlock}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user