pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move admin link (panel) to settings sidebar

Pas 1b5231ae d0db810e

+17 -36
+1 -2
src/assets/locales/en.json
··· 891 891 }, 892 892 "admin": { 893 893 "title": "Admin panel", 894 - "text": "Utilize tools made for testing P-Stream's condition.", 895 - "button": "Check it out" 894 + "text": "Test P-Stream's condition." 896 895 }, 897 896 "actions": { 898 897 "delete": {
-4
src/pages/Settings.tsx
··· 37 37 import { usePreviewThemeStore, useThemeStore } from "@/stores/theme"; 38 38 39 39 import { SubPageLayout } from "./layouts/SubPageLayout"; 40 - import { AdminPanelPart } from "./parts/settings/AdminPanel"; 41 40 import { PreferencesPart } from "./parts/settings/PreferencesPart"; 42 41 43 42 function SettingsLayout(props: { children: React.ReactNode }) { ··· 503 502 ) : ( 504 503 <RegisterCalloutPart /> 505 504 )} 506 - </div> 507 - <div className="mt-10"> 508 - <AdminPanelPart /> 509 505 </div> 510 506 <div id="settings-preferences" className="mt-28"> 511 507 <PreferencesPart
-30
src/pages/parts/settings/AdminPanel.tsx
··· 1 - import { useTranslation } from "react-i18next"; 2 - import { useNavigate } from "react-router-dom"; 3 - 4 - import { Button } from "@/components/buttons/Button"; 5 - import { SolidSettingsCard } from "@/components/layout/SettingsCard"; 6 - import { Heading3 } from "@/components/utils/Text"; 7 - 8 - export function AdminPanelPart() { 9 - const { t } = useTranslation(); 10 - const navigate = useNavigate(); 11 - 12 - return ( 13 - <div> 14 - <SolidSettingsCard 15 - paddingClass="px-6 py-12" 16 - className="grid grid-cols-2 gap-12 mt-5" 17 - > 18 - <div> 19 - <Heading3>{t("settings.account.admin.title")}</Heading3> 20 - <p className="text-type-text">{t("settings.account.admin.text")}</p> 21 - </div> 22 - <div className="flex justify-end items-center"> 23 - <Button theme="purple" onClick={() => navigate("/admin")}> 24 - {t("settings.account.admin.button")} 25 - </Button> 26 - </div> 27 - </SolidSettingsCard> 28 - </div> 29 - ); 30 - }
+16
src/pages/parts/settings/SidebarPart.tsx
··· 1 1 import { useCallback, useEffect, useState } from "react"; 2 2 import { useTranslation } from "react-i18next"; 3 + import { useNavigate } from "react-router-dom"; 3 4 import Sticky from "react-sticky-el"; 4 5 import { useAsync } from "react-use"; 5 6 6 7 import { getBackendMeta } from "@/backend/accounts/meta"; 8 + import { Button } from "@/components/buttons/Button"; 7 9 import { Icon, Icons } from "@/components/Icon"; 8 10 import { SidebarLink, SidebarSection } from "@/components/layout/Sidebar"; 9 11 import { Divider } from "@/components/utils/Divider"; ··· 36 38 // eslint-disable-next-line no-restricted-globals 37 39 const hostname = location.hostname; 38 40 const [activeLink, setActiveLink] = useState(""); 41 + const navigate = useNavigate(); 39 42 40 43 const settingLinks = [ 41 44 { ··· 203 206 t("settings.sidebar.info.unknownVersion") 204 207 )} 205 208 </p> 209 + </div> 210 + 211 + <div className="col-span-2 space-y-1"> 212 + <p className="text-type-dimmed font-medium"> 213 + {t("settings.account.admin.title")} 214 + </p> 215 + <Button 216 + theme="secondary" 217 + onClick={() => navigate("/admin")} 218 + className="w-full !p-2 text-xs" 219 + > 220 + {t("settings.account.admin.text")} 221 + </Button> 206 222 </div> 207 223 </div> 208 224 </SidebarSection>