feat: add user rating

This commit is contained in:
Kentai Radiquum 2024-08-23 19:22:10 +05:00
parent d0990eb089
commit 045ba70436
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
2 changed files with 27 additions and 12 deletions

View file

@ -31,6 +31,7 @@ export const ProfileUser = (props: {
color: string;
}[];
};
rating: number;
}) => {
const router = useRouter();
console.log(props.chips);
@ -76,7 +77,18 @@ export const ProfileUser = (props: {
color={props.isOnline ? "success" : "light"}
>
<div className="space-y-1 text-2xl font-medium whitespace-pre-wrap dark:text-white">
<div className="text-center sm:text-left">{props.login}</div>
<div className="text-center sm:text-left">
{props.login}{" "}
<span
className={`border rounded-md px-2 py-1 text-sm ${
props.rating > 0
? "border-green-500 text-green-500"
: "border-red-500 text-red-500"
}`}
>
{props.rating}
</span>
</div>
<div className="text-sm text-gray-500 whitespace-pre-wrap sm:text-md dark:text-gray-400 ">
{props.status}
</div>

View file

@ -94,7 +94,11 @@ export const ProfilePage = (props: any) => {
/>
<ProfilePrivacyBanner is_privacy={isPrivacy} />
</div>
<div className="mt-4">
<div
className={
isPrivacy || user.is_banned || user.is_perm_banned ? "mt-4" : ""
}
>
<ProfileUser
isOnline={user.is_online}
avatar={user.avatar}
@ -105,16 +109,15 @@ export const ProfilePage = (props: any) => {
hasSocials: hasSocials,
socials: socials,
}}
chips={
{
hasChips: hasChips,
isMyProfile: isMyProfile,
isVerified: user.is_verified,
isSponsor: user.is_sponsor,
isBlocked: user.is_blocked,
roles: user.roles
}
}
chips={{
hasChips: hasChips,
isMyProfile: isMyProfile,
isVerified: user.is_verified,
isSponsor: user.is_sponsor,
isBlocked: user.is_blocked,
roles: user.roles,
}}
rating={user.rating_score}
/>
</div>
</>