Skip to content

Commit 577ea9f

Browse files
committed
add discord link to risk banner
1 parent 735b2d0 commit 577ea9f

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

ui/packages/components/src/common/gcsim/Warning.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ interface WarningProps {
77
hideKey: string;
88
headerKey: string;
99
bodyKey: string;
10+
bodyComponents?: Record<string, React.ReactElement>;
1011
showButton?: boolean;
1112
className?: string;
1213
}
@@ -15,6 +16,7 @@ export function Warning({
1516
hideKey,
1617
headerKey,
1718
bodyKey,
19+
bodyComponents,
1820
showButton = true,
1921
className = "bg-slate-900 border-blue-800",
2022
}: WarningProps) {
@@ -66,7 +68,7 @@ export function Warning({
6668
<img src={tanuki} className="w-15 h-10 mx-0" />
6769
</div>
6870
<div className="space-y-3 pb-3 text-s leading-5 text-gray-400">
69-
<Trans i18nKey={bodyKey}>
71+
<Trans i18nKey={bodyKey} components={bodyComponents}>
7072
<p />
7173
<p>{{ rerun: t('viewer.rerun') }}</p>
7274
<p className="font-semibold leading-6 text-gray-200" />
@@ -75,3 +77,18 @@ export function Warning({
7577
</div>
7678
);
7779
}
80+
81+
export const RiskWarning = () => (
82+
<Warning
83+
hideKey="hide-warning-risk"
84+
headerKey="warnings.gcsim_risk_title"
85+
bodyKey="warnings.gcsim_risk_body"
86+
bodyComponents={{
87+
b: <b />,
88+
p: <p className="text-gray-200" />,
89+
discordlink: <a href="https://discord.gg/m7jvjdxx7q" target="_blank" rel="noreferrer" />,
90+
}}
91+
className="bg-red-950 border-red-800"
92+
showButton={false}
93+
/>
94+
);

ui/packages/db/src/Pages/Database/DBVIew.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import eula from 'images/eula.png';
33
import {useTranslation} from 'react-i18next';
44
import InfiniteScroll from 'react-infinite-scroll-component';
55
import {ActionBar} from 'SharedComponents/ActionBar';
6-
import {Warning} from '@gcsim/components';
6+
import {Warning, RiskWarning} from '@gcsim/components';
77
import {ListView} from '../../SharedComponents/ListView';
88

99
type Props = {
@@ -17,13 +17,7 @@ export const DBView = (props: Props) => {
1717
return (
1818
<div className="flex flex-col gap-4 m-8 my-4 items-center">
1919
<ActionBar simCount={props.data.length} />
20-
<Warning
21-
hideKey="hide-warning-risk"
22-
headerKey="warnings.gcsim_risk_title"
23-
bodyKey="warnings.gcsim_risk_body"
24-
className="bg-red-950 border-red-800"
25-
showButton={false}
26-
/>
20+
<RiskWarning />
2721
<Warning
2822
hideKey="hide-warning-db"
2923
headerKey="db.readme_header"

ui/packages/localization/src/locales/English.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@
393393
"dash_data_header": "Total Sprint Delay Due To Cooldown Per Iteration",
394394
"ignore_burst_energy_title": "\"Ignore Elemental Burst Energy Costs\" Mode Is Enabled",
395395
"ignore_burst_energy_body": "The simulation is ignoring Elemental Burst energy requirements. This may result in inaccurate simulations.",
396-
"gcsim_risk_title": "gcsim's future is at risk",
397-
"gcsim_risk_body": "<2>We are looking for volunteers to work on updates.</2> <0>Users willing to learn the codebase to implement and review newer units/mechanics are needed to release updates in a timely manner. We are also looking for active UI developers.</0> <0>Please message on our Discord with potential interest.</0>"
396+
"gcsim_risk_title": "gcsim's future is at risk!",
397+
"gcsim_risk_body": "<p><b>We are looking for volunteers to work on updates.</b></p> <p>Users willing to learn the codebase to implement and review newer units/mechanics are needed to release updates in a timely manner. We are also looking for active UI developers.</p> <p>Please message on our <discordlink>Discord</discordlink> with potential interest.</p>"
398398
},
399399
"states": {
400400
"true": "true",

ui/packages/ui/src/Pages/Viewer/Viewer.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { RootState, useAppSelector } from "@ui/Stores/store";
1515
import CopyToClipboard from "@ui/Components/Buttons/CopyToClipboard";
1616
import SendToSimulator from "@ui/Components/Buttons/SendToSimulator";
1717
import { useTranslation } from "react-i18next";
18-
import { Warning } from "@gcsim/components";
18+
import { RiskWarning } from "@gcsim/components";
1919

2020
type ViewerProps = {
2121
running: boolean;
@@ -63,13 +63,7 @@ export default ({ running, data, hash = "", recoveryConfig, error, src, redirect
6363
return (
6464
<div className="flex flex-col flex-grow w-full pb-6">
6565
<div className="flex flex-col px-2 pt-4 empty:pt-0 2xl:mx-auto items-center justify-center">
66-
<Warning
67-
hideKey="hide-warning-risk"
68-
headerKey="warnings.gcsim_risk_title"
69-
bodyKey="warnings.gcsim_risk_body"
70-
className="bg-red-950 border-red-800"
71-
showButton={false}
72-
/>
66+
<RiskWarning />
7367
</div>
7468
<Warnings data={data} />
7569
<div className="px-2 py-4 w-full 2xl:mx-auto 2xl:container">

0 commit comments

Comments
 (0)