feat: adjusting ui

This commit is contained in:
Zamitto 2024-10-18 12:31:16 -03:00
parent ab27fd21d7
commit 6c6d13e387
3 changed files with 60 additions and 49 deletions

View file

@ -72,7 +72,7 @@ export function useDate() {
const locale = getDateLocale(); const locale = getDateLocale();
return format( return format(
date, date,
locale == enUS ? "MM/dd/yyyy - HH:mm" : "dd/MM/yyyy - HH:mm" locale == enUS ? "MM/dd/yyyy - HH:mm" : "dd/MM/yyyy HH:mm"
); );
}, },

View file

@ -10,7 +10,6 @@ import {
LockIcon, LockIcon,
PersonIcon, PersonIcon,
TrophyIcon, TrophyIcon,
UnlockIcon,
} from "@primer/octicons-react"; } from "@primer/octicons-react";
import { SPACING_UNIT, vars } from "@renderer/theme.css"; import { SPACING_UNIT, vars } from "@renderer/theme.css";
import { gameDetailsContext } from "@renderer/context"; import { gameDetailsContext } from "@renderer/context";
@ -192,49 +191,55 @@ function AchievementList({ user, otherUser }: AchievementListProps) {
</div> </div>
</div> </div>
<div {otherUserAchievement.unlocked ? (
title={
otherUserAchievement.unlockTime
? formatDateTime(otherUserAchievement.unlockTime)
: undefined
}
>
{otherUserAchievement.unlockTime ? (
<div <div
style={{ style={{
whiteSpace: "nowrap", whiteSpace: "nowrap",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "row",
gap: `${SPACING_UNIT}px`,
justifyContent: "center",
}} }}
> >
<CheckCircleIcon /> <CheckCircleIcon />
<small>{formatDateTime(otherUserAchievement.unlockTime)}</small> <small>{formatDateTime(otherUserAchievement.unlockTime!)}</small>
</div> </div>
) : ( ) : (
<div>
<LockIcon />
</div>
)}
</div>
<div <div
title={ style={{
userDetails?.subscription && achievements[index].unlockTime display: "flex",
? formatDateTime(achievements[index].unlockTime) padding: `${SPACING_UNIT}px`,
: undefined justifyContent: "center",
} }}
> >
{userDetails?.subscription && achievements[index].unlockTime ? (
<div style={{ whiteSpace: "nowrap" }}>
<UnlockIcon />
<p>{formatDateTime(achievements[index].unlockTime)}</p>
</div>
) : (
<div>
<LockIcon /> <LockIcon />
</div> </div>
)} )}
{userDetails?.subscription && achievements[index].unlocked ? (
<div
style={{
whiteSpace: "nowrap",
display: "flex",
flexDirection: "row",
gap: `${SPACING_UNIT}px`,
justifyContent: "center",
}}
>
<CheckCircleIcon />
<small>{formatDateTime(achievements[index].unlockTime!)}</small>
</div> </div>
) : (
<div
style={{
display: "flex",
padding: `${SPACING_UNIT}px`,
justifyContent: "center",
}}
>
<LockIcon />
</div>
)}
</li> </li>
))} ))}
</ul> </ul>
@ -371,17 +376,20 @@ export function AchievementsContent({ otherUser }: AchievementsContentProps) {
</div> </div>
{otherUser && ( {otherUser && (
<div className={styles.panel({ stuck: isHeaderStuck })}> <div className={styles.tableHeader({ stuck: isHeaderStuck })}>
<div <div
style={{ style={{
display: "grid", display: "grid",
gridTemplateColumns: "3fr 1fr 1fr", gridTemplateColumns: "3fr 1fr 1fr",
padding: `${SPACING_UNIT}px`, gap: `${SPACING_UNIT * 2}px`,
padding: `${SPACING_UNIT}px ${SPACING_UNIT * 3}px`,
}} }}
> >
<div></div> <div></div>
<div>{getProfileImage(otherUser)}</div> <div style={{ display: "flex", justifyContent: "center" }}>
<div> {getProfileImage(otherUser)}
</div>
<div style={{ display: "flex", justifyContent: "center" }}>
{getProfileImage({ {getProfileImage({
...userDetails, ...userDetails,
userId: userDetails.id, userId: userDetails.id,

View file

@ -4,6 +4,7 @@ import { recipe } from "@vanilla-extract/recipes";
export const HERO_HEIGHT = 150; export const HERO_HEIGHT = 150;
export const LOGO_HEIGHT = 100; export const LOGO_HEIGHT = 100;
export const LOGO_MAX_WIDTH = 200;
export const wrapper = style({ export const wrapper = style({
display: "flex", display: "flex",
@ -59,7 +60,9 @@ export const heroContent = style({
}); });
export const gameLogo = style({ export const gameLogo = style({
width: LOGO_MAX_WIDTH,
height: LOGO_HEIGHT, height: LOGO_HEIGHT,
objectFit: "contain",
}); });
export const container = style({ export const container = style({
@ -71,7 +74,7 @@ export const container = style({
zIndex: "1", zIndex: "1",
}); });
export const panel = recipe({ export const tableHeader = recipe({
base: { base: {
width: "100%", width: "100%",
backgroundColor: vars.color.darkBackground, backgroundColor: vars.color.darkBackground,