mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
improve badges style
This commit is contained in:
parent
6d491ec696
commit
4fcadcd241
@ -1,5 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import * as antd from "antd"
|
import * as antd from "antd"
|
||||||
|
import classnames from "classnames"
|
||||||
import DOMPurify from "dompurify"
|
import DOMPurify from "dompurify"
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ const RemoteSVG = (props) => {
|
|||||||
export default (props) => {
|
export default (props) => {
|
||||||
let { user_id } = props
|
let { user_id } = props
|
||||||
|
|
||||||
const [L_Badges, R_Badges, E_Badges] = app.cores.api.useRequest(UserModel.getUserBadges, user_id)
|
const [L_Badges, R_Badges, E_Badges] = app.cores.api.useRequest(UserModel.getBadges, user_id)
|
||||||
|
|
||||||
if (E_Badges) {
|
if (E_Badges) {
|
||||||
return null
|
return null
|
||||||
@ -61,10 +62,21 @@ export default (props) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className="badges">
|
return <div
|
||||||
|
className={classnames(
|
||||||
|
"badges",
|
||||||
|
{
|
||||||
|
["single"]: R_Badges.length === 1
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
>
|
||||||
{
|
{
|
||||||
R_Badges.map((badge, index) => {
|
R_Badges.map((badge, index) => {
|
||||||
return <antd.Tooltip index={index} placement="bottom" title={badge.description ?? "An badge"}>
|
return <antd.Tooltip
|
||||||
|
key={index}
|
||||||
|
placement="bottom"
|
||||||
|
title={badge.description ?? "A badge"}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className="badge"
|
className="badge"
|
||||||
|
@ -20,14 +20,20 @@ html {
|
|||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
height: fit-content;
|
min-height: 60px;
|
||||||
|
min-width: 60px;
|
||||||
|
|
||||||
gap: 7px;
|
gap: 7px;
|
||||||
|
|
||||||
background-color: var(--background-color-primary);
|
background-color: var(--background-color-primary);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|
||||||
padding: 7px 15px;
|
padding: 7px;
|
||||||
|
|
||||||
|
&.single {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
padding: 7px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user