chore(git): merge pull request #194 from issues/179-only-logged-in-report into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m0s

Reviewed-on: #194
This commit is contained in:
enes 2025-01-15 18:33:25 +00:00
commit df5ebdb37f
3 changed files with 59 additions and 50 deletions

View File

@ -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'

View File

@ -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}

View File

@ -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}