fix: don't show personal activity if no scores

allow other stuff tho
This commit is contained in:
zkldi
2022-12-23 02:09:23 +00:00
parent 257faa50e3
commit 4560ca150e
3 changed files with 41 additions and 36 deletions
@@ -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>
);
}