feat: ui adjustments

This commit is contained in:
Zamitto 2024-07-10 17:32:32 -03:00
parent 007da03837
commit 0f0a1e98a3
4 changed files with 70 additions and 52 deletions

View File

@ -40,12 +40,11 @@ export function SidebarProfile() {
<div className={styles.profileAvatar}> <div className={styles.profileAvatar}>
{userDetails?.profileImageUrl ? ( {userDetails?.profileImageUrl ? (
<img <img
className={styles.profileAvatar}
src={userDetails.profileImageUrl} src={userDetails.profileImageUrl}
alt={userDetails.displayName} alt={userDetails.displayName}
/> />
) : ( ) : (
<PersonIcon /> <PersonIcon size={24} />
)} )}
</div> </div>

View File

@ -1,4 +1,4 @@
import { UserGame, UserProfile } from "@types"; import { UserFriend, UserGame, UserProfile } from "@types";
import cn from "classnames"; import cn from "classnames";
import * as styles from "./user.css"; import * as styles from "./user.css";
@ -344,13 +344,15 @@ export function UserContent({
height: "1px", height: "1px",
}} }}
/> />
{isMe && (
<button <button
type="button" type="button"
style={{ color: vars.color.body, cursor: "pointer" }} style={{ color: vars.color.body, cursor: "pointer" }}
onClick={() => setShowAddFriendsModal(true)} onClick={() => setShowAddFriendsModal(true)}
> >
<PersonAddIcon /> <PersonAddIcon size={24} />
</button> </button>
)}
</div> </div>
<div <div
@ -360,34 +362,48 @@ export function UserContent({
gap: `${SPACING_UNIT}px`, gap: `${SPACING_UNIT}px`,
}} }}
> >
{(
[
{
id: "",
displayName: "Punheta Master 123123123123123123",
profileImageUrl:
"https://cdn.discordapp.com/avatars/1239959140785455295/4aff4b901c7a9f5f814b4379b6cfd58a.webp",
},
{
id: "",
displayName: "Hydra Launcher",
profileImageUrl: null,
},
] as UserFriend[]
).map((friend) => {
return (
<button <button
className={cn(styles.friendListItem, styles.profileContentBox)} key={friend.id}
onClick={() => handleOnClickFriend("123abcde")} className={cn(
styles.friendListItem,
styles.profileContentBox
)}
onClick={() => handleOnClickFriend(friend.id)}
> >
<div className={styles.friendAvatarContainer}>
{friend.profileImageUrl ? (
<img <img
className={styles.friendProfileIcon} className={styles.friendProfileIcon}
src={ src={friend.profileImageUrl}
"https://cdn.discordapp.com/avatars/1239959140785455295/4aff4b901c7a9f5f814b4379b6cfd58a.webp" alt={friend.displayName}
}
alt={"Punheta Master 123"}
/>
<h4>Punheta Master 123</h4>
</button>
<button
className={cn(styles.friendListItem, styles.profileContentBox)}
>
{userProfile.profileImageUrl ? (
<img
className={styles.friendProfileIcon}
alt={userProfile.displayName}
src={userProfile.profileImageUrl}
/> />
) : ( ) : (
<PersonIcon size={48} /> <PersonIcon size={24} />
)} )}
<h4>Hydra Launcher</h4> </div>
<p className={styles.friendListDisplayName}>
{friend.displayName}
</p>
</button> </button>
);
})}
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,7 +3,6 @@ import {
PersonIcon, PersonIcon,
XCircleIcon, XCircleIcon,
} from "@primer/octicons-react"; } from "@primer/octicons-react";
import { SPACING_UNIT } from "@renderer/theme.css";
import * as styles from "./user.css"; import * as styles from "./user.css";
import cn from "classnames"; import cn from "classnames";
@ -33,11 +32,8 @@ export const UserFriendPendingRequest = ({
type="button" type="button"
className={cn(styles.friendListItem, styles.profileContentBox)} className={cn(styles.friendListItem, styles.profileContentBox)}
onClick={() => onClickRequest(userId)} onClick={() => onClickRequest(userId)}
style={{
padding: "8px",
}}
> >
<div className={styles.pendingFriendRequestAvatarContainer}> <div className={styles.friendAvatarContainer}>
{profileImageUrl ? ( {profileImageUrl ? (
<img <img
className={styles.profileAvatar} className={styles.profileAvatar}
@ -55,10 +51,9 @@ export const UserFriendPendingRequest = ({
alignItems: "flex-start", alignItems: "flex-start",
flex: "1", flex: "1",
minWidth: 0, minWidth: 0,
gap: `${SPACING_UNIT / 2}px`,
}} }}
> >
<h4>{displayName}</h4> <p className={styles.friendListDisplayName}>{displayName}</p>
<small>{isRequestSent ? "Pedido enviado" : "Pedido recebido"}</small> <small>{isRequestSent ? "Pedido enviado" : "Pedido recebido"}</small>
</div> </div>
{isRequestSent ? ( {isRequestSent ? (

View File

@ -35,9 +35,10 @@ export const profileAvatarContainer = style({
zIndex: 1, zIndex: 1,
}); });
export const pendingFriendRequestAvatarContainer = style({ export const friendAvatarContainer = style({
width: "32px", width: "35px",
height: "32px", minWidth: "35px",
height: "35px",
borderRadius: "50%", borderRadius: "50%",
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
@ -46,7 +47,15 @@ export const pendingFriendRequestAvatarContainer = style({
overflow: "hidden", overflow: "hidden",
border: `solid 1px ${vars.color.border}`, border: `solid 1px ${vars.color.border}`,
boxShadow: "0px 0px 5px 0px rgba(0, 0, 0, 0.7)", boxShadow: "0px 0px 5px 0px rgba(0, 0, 0, 0.7)",
zIndex: 1, });
export const friendListDisplayName = style({
fontWeight: "bold",
fontSize: vars.size.body,
textAlign: "left",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}); });
export const profileAvatarEditContainer = style({ export const profileAvatarEditContainer = style({
@ -173,13 +182,12 @@ export const friendListItem = style({
color: vars.color.body, color: vars.color.body,
display: "flex", display: "flex",
flexDirection: "row", flexDirection: "row",
gap: `${SPACING_UNIT}px`, gap: `${SPACING_UNIT + SPACING_UNIT / 2}px`,
width: "100%", width: "100%",
height: "48px", height: "54px",
padding: "0 8px",
transition: "all ease 0.2s", transition: "all ease 0.2s",
cursor: "pointer", cursor: "pointer",
zIndex: "1",
overflow: "hidden",
":hover": { ":hover": {
backgroundColor: "rgba(255, 255, 255, 0.15)", backgroundColor: "rgba(255, 255, 255, 0.15)",
}, },