Skip to content

Commit

Permalink
fix profile picture being hidden on small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Macludde committed Sep 15, 2024
1 parent c42f042 commit 9f7f173
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/routes/(app)/members/[studentId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ export const load: PageServerLoad = async ({ locals, params }) => {
: [];

const email =
(user.studentId === studentId ||
isAuthorized(apiNames.MEMBER.SEE_EMAIL, user)) &&
member.studentId !== null
? await keycloak.getEmail(member.studentId)
user.studentId === studentId ||
isAuthorized(apiNames.MEMBER.SEE_EMAIL, user)
? (member.email ??
(member.studentId !== null
? await keycloak.getEmail(member.studentId)
: undefined))
: undefined;

try {
Expand Down
10 changes: 6 additions & 4 deletions src/routes/(app)/members/[studentId]/ProfileHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
<div
class="order-2 flex flex-row items-center gap-2 text-nowrap lg:order-3"
>
{member.studentId}
{#if email}
{email}
{/if}
<div>{member.studentId}</div>
<ClassBadge {member} size="sm" />
</div>
{#if email}
<div class="order-4 select-all break-all">
{email}
</div>
{/if}
</div>
<div class="hidden sm:block md:hidden">
<slot name="actions" />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/members/[studentId]/ProfilePage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</MemberAvatar>
</div>
<!-- Name, StiL-ID, badge and actions -->
<header class="md:col-start-2 md:col-end-4">
<header class="overflow-x-auto md:col-start-2 md:col-end-4">
<ProfileHeader {member} email={data.email}>
<div slot="actions" class="flex gap-2">
{#if canEdit}
Expand Down

0 comments on commit 9f7f173

Please sign in to comment.