mirror of
https://github.com/khairul169/github-leaderboard.git
synced 2025-04-28 15:39:31 +07:00
feat: allow view user on user by lang category
This commit is contained in:
parent
9ed2984dbd
commit
a7e024e8d7
@ -15,7 +15,7 @@ import { pointWeights } from "../data";
|
||||
|
||||
const ViewSheet = () => {
|
||||
const { type, id } = useParams();
|
||||
const username = type === "user" ? id : null;
|
||||
const username = type !== "lang" ? id : null;
|
||||
const { data, refetch } = useGetUserLeaderboard(username);
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -88,7 +88,7 @@ const ViewSheet = () => {
|
||||
<BottomSheet
|
||||
open={!!username}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) navigate("/user", { replace: true });
|
||||
if (!open) navigate(`/${type}`, { replace: true });
|
||||
}}
|
||||
className="h-[90%]"
|
||||
>
|
||||
|
@ -48,7 +48,7 @@ const HomePage = () => {
|
||||
name={item.name}
|
||||
avatar={item.image}
|
||||
sub={item.sub}
|
||||
onClick={type === "user" ? () => onView(item.id!) : undefined}
|
||||
onClick={type !== "lang" ? () => onView(item.id!) : undefined}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@ -66,7 +66,7 @@ const HomePage = () => {
|
||||
rank={item.rank}
|
||||
columns={data.columns}
|
||||
data={item}
|
||||
onClick={type === "user" ? () => onView(item.id!) : undefined}
|
||||
onClick={type !== "lang" ? () => onView(item.id!) : undefined}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user