diff --git a/public/locales/en.json b/public/locales/en.json index 081aea8..2fb3549 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -135,7 +135,7 @@ "columnTime": "Time" }, - "status": "KristWeb 2 is still in development. If you are not a donator, then you should not be here. Do not host this website.", + "status": "KristWeb 2 is still in development. If you are not a donor, then you should not be here. Do not host this website.", "addWallet": { "dialogTitle": "Add wallet", @@ -199,6 +199,8 @@ "dashboard": { "siteTitle": "Dashboard", + "inDevBanner": "Welcome to the KristWeb v2 private beta! This site is still in development, so most features are currently missing. Please report all bugs on <1>GitHub. Thanks!", + "walletOverviewCardTitle": "Wallets", "walletOverviewTotalBalance": "Total balance", "walletOverviewNames": "Names", diff --git a/src/layout/nav/AppHeader.tsx b/src/layout/nav/AppHeader.tsx index 908bd01..61a341f 100644 --- a/src/layout/nav/AppHeader.tsx +++ b/src/layout/nav/AppHeader.tsx @@ -38,8 +38,8 @@ {/* Send and receive buttons */} {bps.md && - }>{t("nav.send")} - }>{t("nav.request")} + }>{t("nav.send")} + }>{t("nav.request")} } {/* Spacer to push search box to the right */} diff --git a/src/layout/sidebar/Sidebar.tsx b/src/layout/sidebar/Sidebar.tsx index 0e0d7a0..4a9c00f 100644 --- a/src/layout/sidebar/Sidebar.tsx +++ b/src/layout/sidebar/Sidebar.tsx @@ -18,27 +18,29 @@ icon: React.ReactNode; name: string; + nyi?: boolean; + group?: "network"; } const sidebarItems: SidebarItemProps[] = [ { icon: , name: "dashboard", to: "/" }, { icon: , name: "myWallets", to: "/wallets" }, - { icon: , name: "addressBook", to: "/friends" }, - { icon: , name: "transactions", to: "/me/transactions" }, - { icon: , name: "names", to: "/me/names" }, - { icon: , name: "mining", to: "/mining" }, + { icon: , name: "addressBook", to: "/friends", nyi: true }, + { icon: , name: "transactions", to: "/me/transactions", nyi: true }, + { icon: , name: "names", to: "/me/names", nyi: true }, + { icon: , name: "mining", to: "/mining", nyi: true }, - { group: "network", icon: , name: "blocks", to: "/network/blocks" }, - { group: "network", icon: , name: "transactions", to: "/network/transactions" }, - { group: "network", icon: , name: "names", to: "/network/names" }, - { group: "network", icon: , name: "statistics", to: "/network/statistics" }, + { group: "network", icon: , name: "blocks", to: "/network/blocks", nyi: true }, + { group: "network", icon: , name: "transactions", to: "/network/transactions", nyi: true }, + { group: "network", icon: , name: "names", to: "/network/names", nyi: true }, + { group: "network", icon: , name: "statistics", to: "/network/statistics", nyi: true }, ]; function getSidebarItems(t: TFunction, group?: string) { return sidebarItems .filter(i => i.group === group) .map(i => ( - + {t("sidebar." + i.name)} )); diff --git a/src/layout/sidebar/SidebarFooter.tsx b/src/layout/sidebar/SidebarFooter.tsx index fb06b7b..fa00d23 100644 --- a/src/layout/sidebar/SidebarFooter.tsx +++ b/src/layout/sidebar/SidebarFooter.tsx @@ -4,10 +4,10 @@ import React, { useState } from "react"; import { useTranslation, Trans } from "react-i18next"; -import packageJson from "../../../package.json"; import { Link } from "react-router-dom"; import { useMountEffect } from "../../utils"; +import { getAuthorInfo } from "../../utils/credits"; export function SidebarFooter(): JSX.Element { const { t } = useTranslation(); @@ -26,9 +26,7 @@ })(); }); - const authorName = packageJson.author || "Lemmmy"; - const authorURL = `https://github.com/${authorName}`; - const gitURL = packageJson.repository.url.replace(/\.git$/, ""); + const { authorName, authorURL, gitURL } = getAuthorInfo(); return (
diff --git a/src/pages/credits/CreditsPage.tsx b/src/pages/credits/CreditsPage.tsx index c44a2a1..98347a9 100644 --- a/src/pages/credits/CreditsPage.tsx +++ b/src/pages/credits/CreditsPage.tsx @@ -5,20 +5,19 @@ import { Typography, Divider } from "antd"; import { useTranslation, Trans } from "react-i18next"; -import packageJson from "../../../package.json"; - import { PageLayout } from "../../layout/PageLayout"; import { Supporters } from "./Supporters"; import { Translators } from "./Translators"; import "./CreditsPage.less"; +import { getAuthorInfo } from "../../utils/credits"; + const { Title } = Typography; export function CreditsPage(): JSX.Element { const { t } = useTranslation(); - const authorName = packageJson.author || "Lemmmy"; - const authorURL = `https://github.com/${authorName}`; + const { authorName, authorURL } = getAuthorInfo(); return KristWeb v2 diff --git a/src/pages/dashboard/DashboardPage.tsx b/src/pages/dashboard/DashboardPage.tsx index 91c4cd1..f0a2e3d 100644 --- a/src/pages/dashboard/DashboardPage.tsx +++ b/src/pages/dashboard/DashboardPage.tsx @@ -6,6 +6,8 @@ import { PageLayout } from "../../layout/PageLayout"; +import { InDevBanner } from "./InDevBanner"; + import { WalletOverviewCard } from "./WalletOverviewCard"; import { TransactionsCard } from "./TransactionsCard"; import { BlockValueCard } from "./BlockValueCard"; @@ -15,6 +17,8 @@ export function DashboardPage(): JSX.Element { return + + diff --git a/src/pages/dashboard/InDevBanner.tsx b/src/pages/dashboard/InDevBanner.tsx new file mode 100644 index 0000000..7bf5720 --- /dev/null +++ b/src/pages/dashboard/InDevBanner.tsx @@ -0,0 +1,26 @@ +// Copyright (c) 2020-2021 Drew Lemmy +// This file is part of KristWeb 2 under GPL-3.0. +// Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt +import React from "react"; +import { Alert } from "antd"; + +import { useTranslation, Trans } from "react-i18next"; + +import { getAuthorInfo } from "../../utils/credits"; + +export function InDevBanner(): JSX.Element { + const { t } = useTranslation(); + + const { gitURL } = getAuthorInfo(); + + return + Welcome to the KristWeb v2 private beta! This site is still in development, + so most features are currently missing. Please report all bugs on + GitHub. + Thanks! + } + />; +} diff --git a/src/pages/wallets/WalletsPage.tsx b/src/pages/wallets/WalletsPage.tsx index 6ccf122..49a3ec1 100644 --- a/src/pages/wallets/WalletsPage.tsx +++ b/src/pages/wallets/WalletsPage.tsx @@ -31,7 +31,9 @@ const [addWalletVisible, setAddWalletVisible] = useState(false); return <> - + setCreateWalletVisible(true)}>