Can start Matrix authentication from UI

This commit is contained in:
2025-11-05 18:27:41 +01:00
parent 3dab9f41d2
commit 37fad9ff55
12 changed files with 195 additions and 6 deletions

View File

@@ -0,0 +1,37 @@
import { Typography } from "@mui/material";
import React, { type PropsWithChildren } from "react";
export function MatrixGWRouteContainer(
p: {
label: string | React.ReactElement;
actions?: React.ReactElement;
} & PropsWithChildren
): React.ReactElement {
return (
<div
style={{
margin: "50px",
flexGrow: 1,
flexShrink: 0,
flexBasis: 0,
minWidth: 0,
display: "flex",
flexDirection: "column",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
marginBottom: "20px",
}}
>
<Typography variant="h4">{p.label}</Typography>
{p.actions ?? <></>}
</div>
{p.children}
</div>
);
}

View File

@@ -0,0 +1,14 @@
export function NotLinkedAccountMessage(): React.ReactElement {
return (
<div
style={{
flex: 1,
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
Your Matrix account is not linked yet!
</div>
);
}

View File

@@ -124,7 +124,6 @@ export default function BaseAuthenticatedPage(): React.ReactElement {
flexDirection: "column",
flex: 1,
overflow: "auto",
padding: "50px",
}}
>
<Outlet />
@@ -137,6 +136,6 @@ export default function BaseAuthenticatedPage(): React.ReactElement {
);
}
export function userUserInfo(): UserInfoContext {
export function useUserInfo(): UserInfoContext {
return React.use(UserInfoContextK)!;
}

View File

@@ -14,7 +14,7 @@ import Tooltip from "@mui/material/Tooltip";
import Typography from "@mui/material/Typography";
import * as React from "react";
import { RouterLink } from "../RouterLink";
import { userUserInfo as useUserInfo } from "./BaseAuthenticatedPage";
import { useUserInfo } from "./BaseAuthenticatedPage";
import ThemeSwitcher from "./ThemeSwitcher";
const AppBar = styled(MuiAppBar)(({ theme }) => ({

View File

@@ -107,7 +107,7 @@ export default function DashboardSidebar({
<DashboardSidebarPageItem
title="Matrix link"
icon={<Icon path={mdiLinkLock} size={"1.5em"} />}
href="/matrixlink"
href="/matrix_link"
/>
<DashboardSidebarPageItem
title="API tokens"