From 8eabc479150c08977d8724aca51186a12b3ddaa1 Mon Sep 17 00:00:00 2001 From: trashtemp <96388163+trashtemp@users.noreply.github.com> Date: Tue, 21 Dec 2021 13:26:47 +0100 Subject: [PATCH] fix(profile): finished modal design --- .../popovers/UserProfile.module.scss | 11 +- .../intermediate/popovers/UserProfile.tsx | 225 +++++++++--------- 2 files changed, 127 insertions(+), 109 deletions(-) diff --git a/src/context/intermediate/popovers/UserProfile.module.scss b/src/context/intermediate/popovers/UserProfile.module.scss index 0d67980e..8ff114ba 100644 --- a/src/context/intermediate/popovers/UserProfile.module.scss +++ b/src/context/intermediate/popovers/UserProfile.module.scss @@ -86,12 +86,13 @@ .content { gap: 8px; + min-height: 240px; + max-height: 240px; height: 100%; display: flex; padding: 1em 1.5em; max-width: 560px; - max-height: 240px; overflow-y: auto; flex-direction: column; @@ -100,8 +101,14 @@ .empty { display: flex; - justify-content: center; + gap: 10px; + flex-direction: column; align-items: center; + justify-content: center; + opacity: 0.5; + flex-grow: 1; + + font-weight: 500; } .category { diff --git a/src/context/intermediate/popovers/UserProfile.tsx b/src/context/intermediate/popovers/UserProfile.tsx index 7897316b..8594d2db 100644 --- a/src/context/intermediate/popovers/UserProfile.tsx +++ b/src/context/intermediate/popovers/UserProfile.tsx @@ -1,4 +1,11 @@ -import { Envelope, Edit, UserPlus } from "@styled-icons/boxicons-solid"; +import { ListUl } from "@styled-icons/boxicons-regular"; +import { + Envelope, + Edit, + UserPlus, + Group, + InfoCircle, +} from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; import { Link, useHistory } from "react-router-dom"; import { Profile, RelationshipStatus } from "revolt-api/types/Users"; @@ -150,6 +157,7 @@ export const UserProfile = observer( backgroundImage: backgroundURL && `linear-gradient( rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7) ), url('${backgroundURL}')`, + paddingBottom: "1px", }}>
- {tab === "profile" && ( -
- {!( - profile?.content || - badges > 0 || - flags > 0 || - user.bot - ) && ( -
- -
- )} - {flags & 1 ? ( - /** ! FIXME: i18n this area */ - - User is suspended - - ) : undefined} - {flags & 2 ? ( - - User deleted their account - - ) : undefined} - {flags & 4 ? ( - - User is banned - - ) : undefined} - {user.bot ? ( - <> -
- bot owner -
-
- user.bot && - openScreen({ - id: "profile", - user_id: user.bot.owner, - }) - } - className={styles.entry} - key={user.bot.owner}> - - - 0 || + flags > 0 || + user.bot ? ( +
+ {flags & 1 ? ( + /** ! FIXME: i18n this area */ + + User is suspended + + ) : undefined} + {flags & 2 ? ( + + User deleted their account + + ) : undefined} + {flags & 4 ? ( + + User is banned + + ) : undefined} + {user.bot ? ( + <> +
+ bot owner +
+
+ user.bot && + openScreen({ + id: "profile", + user_id: user.bot.owner, + }) + } + className={styles.entry} + key={user.bot.owner}> + - + + + +
+ + ) : undefined} + {badges > 0 && ( +
+
- - ) : undefined} - {badges > 0 && ( -
- -
- )} - {badges > 0 && ( - - )} - {profile?.content && ( -
- -
- )} - - {/*
*/} -
- )} + )} + {badges > 0 && ( + + )} + {profile?.content && ( +
+ +
+ )} + + {/*
*/} +
+ ) : ( +
+ + +
+ ))} {tab === "friends" && (users ? ( -
- {users.length === 0 ? ( -
- -
- ) : ( - users.map( + users.length === 0 ? ( +
+ + +
+ ) : ( +
+ {users.map( (x) => x && (
{x.username}
), - ) - )} -
+ )} +
+ ) ) : ( ))} - {tab === "groups" && ( -
- {mutualGroups.length === 0 ? ( -
- -
- ) : ( - mutualGroups.map( + {tab === "groups" && + (mutualGroups.length === 0 ? ( +
+ + +
+ ) : ( +
+ {mutualGroups.map( (x) => x?.channel_type === "Group" && ( @@ -386,18 +398,18 @@ export const UserProfile = observer(
), - ) - )} -
- )} - {tab === "servers" && ( -
- {!mutualServers || mutualServers.length === 0 ? ( -
- -
- ) : ( - mutualServers.map( + )} +
+ ))} + {tab === "servers" && + (!mutualServers || mutualServers.length === 0 ? ( +
+ + +
+ ) : ( +
+ {mutualServers.map( (x) => x && ( @@ -412,10 +424,9 @@ export const UserProfile = observer(
), - ) - )} -
- )} + )} +
+ ))} );