Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make profile private for user block above -1 #7

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/components/RetroButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ export const DynamicLoginButton = () => {
const { name } = user;
if (user.isSignedIn) {
return (
<Link href={`/u/${user.id}`} passHref>
<SmallButton>
<ProfileImage image={user.profile?.photo} />
{name}
</SmallButton>
</Link>
<>
{user?.block !== undefined && user?.block >= 0 ? (
<Link href={`/u/${user.id}`} passHref>
<SmallButton>
<ProfileImage image={user.profile?.photo} />
{name}
</SmallButton>
</Link>
) : null}
</>
);
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/u/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Profile = () => {
}
}, [user]);

if (!user) {
if (!user || (user?.block !== undefined && user?.block < 0)) {
return <Main> User not found </Main>;
}
return (
Expand Down