Compare commits
3 Commits
3c8a17f336
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 51762f8d18 | |||
| 002b22ff0e | |||
| 885ccdcfa7 |
@@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Box, Typography } from "@mui/material";
|
import { Box, Typography, Avatar } from "@mui/material";
|
||||||
import type { FieldConfig } from "../../types";
|
import type { FieldConfig } from "../../types";
|
||||||
import { ListCellRenderer } from "./ListCellRenderer";
|
import { ListCellRenderer } from "./ListCellRenderer";
|
||||||
|
|
||||||
@@ -18,7 +18,11 @@ export function DetailFieldRenderer({ field, value, displayFormat, basePath }: D
|
|||||||
<Typography variant="caption" color="text.secondary" fontWeight={600} sx={{ mb: 0.25, display: "block" }}>
|
<Typography variant="caption" color="text.secondary" fontWeight={600} sx={{ mb: 0.25, display: "block" }}>
|
||||||
{field.label}
|
{field.label}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ListCellRenderer field={field} value={value} displayFormat={displayFormat} basePath={basePath} />
|
{field.uiType === "image" ? (
|
||||||
|
<Avatar src={value} variant="rounded" sx={{ width: 120, height: 120 }} />
|
||||||
|
) : (
|
||||||
|
<ListCellRenderer field={field} value={value} displayFormat={displayFormat} basePath={basePath} />
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/main.jsx
12
src/main.jsx
@@ -10,6 +10,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
CssBaseline,
|
CssBaseline,
|
||||||
|
CircularProgress,
|
||||||
Toolbar
|
Toolbar
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import Home from './Home';
|
import Home from './Home';
|
||||||
@@ -81,8 +82,17 @@ const routerMapping = [
|
|||||||
|
|
||||||
/** Reads authConfig from AppProvider context and passes it to AuthProvider. */
|
/** Reads authConfig from AppProvider context and passes it to AuthProvider. */
|
||||||
function AppContent() {
|
function AppContent() {
|
||||||
const { authConfig } = useAppContext();
|
const { authConfig, loading } = useAppContext();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<Box sx={{ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh" }}>
|
||||||
|
<CircularProgress />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthProvider authConfig={authConfig} onUnauthorized={() => navigate("/login")}>
|
<AuthProvider authConfig={authConfig} onUnauthorized={() => navigate("/login")}>
|
||||||
<AppTheme>
|
<AppTheme>
|
||||||
|
|||||||
Reference in New Issue
Block a user