mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-11 08:48:15 +03:00
fix: don't show personal activity if no scores
allow other stuff tho
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import Activity from "components/activity/Activity";
|
||||
import React from "react";
|
||||
import { AllLUGPTStatsContext } from "context/AllLUGPTStatsContext";
|
||||
import React, { useContext } from "react";
|
||||
import { UserDocument } from "tachi-common";
|
||||
import { DashboardLoggedInNoScores } from "./DashboardLoggedInNoScores";
|
||||
|
||||
export default function DashboardActivity({ user }: { user: UserDocument }) {
|
||||
const { ugs } = useContext(AllLUGPTStatsContext);
|
||||
|
||||
if (ugs?.length === 0) {
|
||||
return <DashboardLoggedInNoScores user={user} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="display-4 mb-4">Here's what's been happening.</div>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import Divider from "components/util/Divider";
|
||||
import LinkButton from "components/util/LinkButton";
|
||||
import { TachiConfig } from "lib/config";
|
||||
import React from "react";
|
||||
import { UserDocument } from "tachi-common";
|
||||
|
||||
export function DashboardLoggedInNoScores({ user }: { user: UserDocument }) {
|
||||
return (
|
||||
<div>
|
||||
<span className="display-4">
|
||||
Welcome to {TachiConfig.name}, {user.username}!
|
||||
</span>
|
||||
<h4 className="mt-4">It looks like you have no scores. Let's get you set up!</h4>
|
||||
<Divider />
|
||||
<h4 style={{ lineHeight: 2 }}>
|
||||
Once you've got some scores imported, we'll analyse your scores.
|
||||
<br />
|
||||
You'll get a profile for that game, and a position on the leaderboards!
|
||||
</h4>
|
||||
<LinkButton className="btn-outline-primary" to="/import">
|
||||
Import some scores!
|
||||
</LinkButton>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user