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

Veřejné uživatelské profily 1.0 #1043

Merged
merged 49 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ba24866
Empty commit to jumpstart PR
zoul Jul 3, 2024
86047ce
Add support for new “enablePublicProfile” privacy flag
zoul Jul 4, 2024
06e7b79
Add first draft of people directory
zoul Jul 4, 2024
3e6685f
Improve breadcrumbs
zoul Jul 4, 2024
3e06d13
Add navigation menu item for People
zoul Jul 4, 2024
d4c1216
Add page intro placeholder
zoul Jul 4, 2024
2142fcf
Link user profile card to detail page
zoul Jul 4, 2024
535d0ee
Add basic user profile details
zoul Jul 4, 2024
bd56bd1
Add project engagement section to user profile
zoul Jul 8, 2024
b96d62e
User shared UserProfileCard for team engagements
zoul Jul 8, 2024
d3a4611
Add links to user profiles where appropriate
zoul Jul 8, 2024
2b353f6
Add basic Slack contact button
zoul Jul 9, 2024
177f51c
Display user locations in hashtags
zoul Jul 9, 2024
4fa95a0
Filter out the #Other category from hashtags
zoul Jul 9, 2024
be297f6
Improve user profile responsivity
zoul Jul 9, 2024
ff000ea
Display user bio on profile if available
zoul Jul 10, 2024
016cbf2
Hide non-public user profiles
zoul Jul 10, 2024
68412f4
feat: opt-in public profile in user registration
drahoja9 Jul 9, 2024
20cde9b
Toggle public profile visibility in user settings (#1057)
laurabaluchova Jul 11, 2024
71e832f
Trivial type refactoring
zoul Jul 11, 2024
e134664
Improve shared button styles
zoul Jul 11, 2024
0cd846a
Add user bio during registration (#1060)
drahoja9 Jul 12, 2024
ea4ad5b
Improve private profile layout
zoul Jul 12, 2024
4691320
Tighten the withDefault higher-order decoder
zoul Jul 12, 2024
b317a65
Improve user avatar handling
zoul Jul 12, 2024
35cce74
Update /profile/me API endpoint to also accept bio changes
zoul Jul 15, 2024
c39f4aa
Update bio in user profile (#1062)
laurabaluchova Jul 16, 2024
d0966ba
Move BioState type to usage site
zoul Jul 16, 2024
be9744c
Improve user profile wording
zoul Jul 16, 2024
1bffc30
Refactor user profile tab into sections
zoul Jul 16, 2024
73cdf6d
Merge district selection into user profile tab
zoul Jul 16, 2024
836ac5a
Improve copy
zoul Jul 16, 2024
4786e4b
Merge privacy settings into profile page
zoul Jul 17, 2024
d97e61d
Add link to user profile to profile settings page
zoul Jul 17, 2024
36c1c8d
Improve profile link display logic
zoul Jul 17, 2024
71ea72b
Honor project engagement opt-out on public user profile
zoul Jul 17, 2024
ac5530f
Add Edit button to public user profile
zoul Jul 17, 2024
1b86aa3
Remove unused import
zoul Jul 17, 2024
8e00fd8
Improve copy
zoul Jul 17, 2024
214c8b1
Rename /profile/* to /account/*
zoul Jul 17, 2024
2d56286
Only display e-mail contact if we have a public contact address
zoul Jul 17, 2024
601cc50
Add UI to change public contact e-mail in user profile, fixes #1064
zoul Jul 17, 2024
5974943
Update copy
zoul Jul 18, 2024
06c2df5
Improve checkbox logic & copy
zoul Jul 18, 2024
46a8e40
Add error logging to user profile fetch function
zoul Jul 18, 2024
1703e35
Be more precise in copy about registration e-mail
zoul Jul 18, 2024
bb1f0ca
Add professional profile link to user profile page
zoul Jul 18, 2024
5ecfdaa
Improve registration form copy
zoul Jul 18, 2024
92ea13e
Improve registration form copy
zoul Jul 18, 2024
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
11 changes: 5 additions & 6 deletions app/SessionToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type Session } from "next-auth";
import { signIn, useSession } from "next-auth/react";

import { Route } from "~/src/routing";
import { defaultAvatarUrl } from "~/src/utils";

export const SessionToolbar = () => {
const { data: session, status } = useSession();
Expand All @@ -21,9 +22,7 @@ export const SessionToolbar = () => {
};

const SignedInButtons = ({ session }: { session: Session }) => {
const avatarImage =
session.user?.image ??
"https://data.cesko.digital/people/generic-profile.jpg";
const avatarImage = session.user?.image ?? defaultAvatarUrl;
const avatarTitle =
session.user?.name && session.user?.email
? `${session.user?.name} (${session.user?.email})`
Expand All @@ -32,18 +31,18 @@ const SignedInButtons = ({ session }: { session: Session }) => {
return (
<div className="flex flex-row gap-7 text-base md:-mb-[3px]">
<Link
href={Route.userProfile}
href={Route.account}
className="typo-link flex flex-row-reverse items-center gap-4 lg:flex-row"
>
<Image
className="rounded-full bg-gray shadow"
src={avatarImage}
alt={session.user?.name ?? "Uživatelský profil"}
alt={session.user?.name ?? "Můj účet"}
title={avatarTitle}
width={30}
height={30}
/>
Můj profil
Můj účet
</Link>
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions app/SiteNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export const SecondLevelNav = () => {
Akce
</Link>
</li>
<li>
<Link href={Route.people} className={activeOnPrefix("/people")}>
Lidé
</Link>
</li>
</ul>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Props = { userMail: string };

export const NewsletterTab = ({ userMail }: Props) => {
const { model, setModel, updating } = useJSONResource({
url: "/profile/newsletters",
url: "/account/newsletters",
decoder: decodeNewsletterPreferences,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = {

export const NotificationsTab = ({ userEmail }: Props) => {
const { model, updating, setModel } = usePatchedJSONResource<UserProfile>({
url: "/profile/me",
url: "/account/me",
writeKeys: ["notificationFlags"],
});

Expand Down
22 changes: 5 additions & 17 deletions app/profile/SignedInPage.tsx → app/account/SignedInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ import SlackIcon from "~/components/icons/slack";
import { SimpleTabBar } from "~/components/TabBar";
import { Route } from "~/src/routing";

import { MapTab } from "./MapTab";
import { NewsletterTab } from "./NewsletterTab";
import { NotificationsTab } from "./NotificationsTab";
import { PrivacyTab } from "./PrivacyTab";
import { SkillsTab } from "./SkillsTab";
import { UserProfileTab } from "./UserProfileTab";

export const SignedInPage = ({ session }: { session: Session }) => {
const tabs = [
{
title: "Dovednosti",
hash: "skills",
content: <SkillsTab />,
title: "Profil",
hash: "profile",
content: <UserProfileTab />,
},
{
title: "Newslettery",
Expand All @@ -29,16 +27,6 @@ export const SignedInPage = ({ session }: { session: Session }) => {
hash: "notifications",
content: <NotificationsTab userEmail={session.user!.email!} />,
},
{
title: "Mapa komunity",
hash: "community-map",
content: <MapTab />,
},
{
title: "Soukromí",
hash: "privacy",
content: <PrivacyTab />,
},
{
title: "Nástroje",
hash: "tools",
Expand All @@ -47,7 +35,7 @@ export const SignedInPage = ({ session }: { session: Session }) => {
];
return (
<section>
<h1 className="typo-title mb-4 mt-7">{session.user?.name}</h1>
<h1 className="typo-title mb-4 mt-7">Můj účet</h1>
<SimpleTabBar items={tabs} />
</section>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Route } from "~/src/routing";
export const SignedOutPage = () => {
const handleSignIn = async () => {
trackCustomEvent("SignIn");
await signIn(undefined, { callbackUrl: Route.userProfile });
await signIn(undefined, { callbackUrl: Route.account });
};
return (
<section className="m-auto mt-10 flex max-w-[80ex] flex-col gap-7 rounded-2xl border-2 border-gray p-7 pb-10 text-center lg:mt-20">
Expand Down
Loading
Loading