mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-28 18:00:59 -05:00
fix(profile): finished modal design
This commit is contained in:
parent
9ab7e5718f
commit
8eabc47915
2 changed files with 127 additions and 109 deletions
|
@ -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 {
|
||||
|
|
|
@ -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",
|
||||
}}>
|
||||
<div className={styles.profile}>
|
||||
<UserIcon
|
||||
|
@ -255,18 +263,12 @@ export const UserProfile = observer(
|
|||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{tab === "profile" && (
|
||||
<div>
|
||||
{!(
|
||||
profile?.content ||
|
||||
{tab === "profile" &&
|
||||
(profile?.content ||
|
||||
badges > 0 ||
|
||||
flags > 0 ||
|
||||
user.bot
|
||||
) && (
|
||||
<div className={styles.empty}>
|
||||
<Text id="app.special.popovers.user_profile.empty" />
|
||||
</div>
|
||||
)}
|
||||
user.bot ? (
|
||||
<div>
|
||||
{flags & 1 ? (
|
||||
/** ! FIXME: i18n this area */
|
||||
<Overline type="error" block>
|
||||
|
@ -320,7 +322,10 @@ export const UserProfile = observer(
|
|||
</div>
|
||||
)}
|
||||
{badges > 0 && (
|
||||
<UserBadges badges={badges} uid={user._id} />
|
||||
<UserBadges
|
||||
badges={badges}
|
||||
uid={user._id}
|
||||
/>
|
||||
)}
|
||||
{profile?.content && (
|
||||
<div className={styles.category}>
|
||||
|
@ -330,16 +335,22 @@ export const UserProfile = observer(
|
|||
<Markdown content={profile?.content} />
|
||||
{/*<div className={styles.category}><Text id="app.special.popovers.user_profile.sub.connections" /></div>*/}
|
||||
</div>
|
||||
)}
|
||||
) : (
|
||||
<div className={styles.empty}>
|
||||
<InfoCircle size={72} />
|
||||
<Text id="app.special.popovers.user_profile.empty" />
|
||||
</div>
|
||||
))}
|
||||
{tab === "friends" &&
|
||||
(users ? (
|
||||
<div className={styles.entries}>
|
||||
{users.length === 0 ? (
|
||||
users.length === 0 ? (
|
||||
<div className={styles.empty}>
|
||||
<UserPlus size={72} />
|
||||
<Text id="app.special.popovers.user_profile.no_users" />
|
||||
</div>
|
||||
) : (
|
||||
users.map(
|
||||
<div className={styles.entries}>
|
||||
{users.map(
|
||||
(x) =>
|
||||
x && (
|
||||
<div
|
||||
|
@ -358,20 +369,21 @@ export const UserProfile = observer(
|
|||
<span>{x.username}</span>
|
||||
</div>
|
||||
),
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
<Preloader type="ring" />
|
||||
))}
|
||||
{tab === "groups" && (
|
||||
<div className={styles.entries}>
|
||||
{mutualGroups.length === 0 ? (
|
||||
{tab === "groups" &&
|
||||
(mutualGroups.length === 0 ? (
|
||||
<div className={styles.empty}>
|
||||
<Group size="72" />
|
||||
<Text id="app.special.popovers.user_profile.no_groups" />
|
||||
</div>
|
||||
) : (
|
||||
mutualGroups.map(
|
||||
<div className={styles.entries}>
|
||||
{mutualGroups.map(
|
||||
(x) =>
|
||||
x?.channel_type === "Group" && (
|
||||
<Link to={`/channel/${x._id}`}>
|
||||
|
@ -386,18 +398,18 @@ export const UserProfile = observer(
|
|||
</div>
|
||||
</Link>
|
||||
),
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{tab === "servers" && (
|
||||
<div className={styles.entries}>
|
||||
{!mutualServers || mutualServers.length === 0 ? (
|
||||
))}
|
||||
{tab === "servers" &&
|
||||
(!mutualServers || mutualServers.length === 0 ? (
|
||||
<div className={styles.empty}>
|
||||
<ListUl size="72" />
|
||||
<Text id="app.special.popovers.user_profile.no_servers" />
|
||||
</div>
|
||||
) : (
|
||||
mutualServers.map(
|
||||
<div className={styles.entries}>
|
||||
{mutualServers.map(
|
||||
(x) =>
|
||||
x && (
|
||||
<Link to={`/server/${x._id}`}>
|
||||
|
@ -412,10 +424,9 @@ export const UserProfile = observer(
|
|||
</div>
|
||||
</Link>
|
||||
),
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
))}
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue