Compare commits
6 Commits
7b8f6c02e9
...
921570f229
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
921570f229 | ||
|
|
48ec0d9fb4 | ||
|
|
2e4d39be6d | ||
|
|
a3bd238885 | ||
|
|
991af83c2e | ||
|
|
56f11f62ea |
35
src/App.tsx
35
src/App.tsx
@@ -2,7 +2,7 @@ import { createTheme, CssBaseline, GlobalStyles, styled, ThemeProvider, useMedia
|
||||
import { grey } from "@mui/material/colors";
|
||||
import { ThemeOptions } from "@mui/material/styles/createTheme";
|
||||
import i18next from "i18next";
|
||||
import { enqueueSnackbar, MaterialDesignContent, SnackbarProvider } from "notistack";
|
||||
import { enqueueSnackbar, MaterialDesignContent, SnackbarProvider, useSnackbar } from "notistack";
|
||||
import { Suspense, useEffect, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Outlet } from "react-router-dom";
|
||||
@@ -21,7 +21,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
...themeConfig,
|
||||
shape: {
|
||||
...themeConfig.shape,
|
||||
borderRadius: 12,
|
||||
borderRadius: 4,
|
||||
},
|
||||
components: {
|
||||
MuiCssBaseline: {
|
||||
@@ -31,6 +31,18 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
},
|
||||
},
|
||||
},
|
||||
MuiBackdrop: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
||||
backdropFilter: "blur(8px)",
|
||||
"&.MuiBackdrop-invisible": {
|
||||
backgroundColor: "transparent",
|
||||
backdropFilter: "none",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
MuiTooltip: {
|
||||
defaultProps: {
|
||||
enterDelay: 500,
|
||||
@@ -63,7 +75,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
MuiListItemButton: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
borderRadius: 12,
|
||||
borderRadius: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -82,7 +94,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
MuiMenu: {
|
||||
styleOverrides: {
|
||||
paper: {
|
||||
borderRadius: "8px",
|
||||
borderRadius: "4px",
|
||||
},
|
||||
list: {
|
||||
padding: "4px 0",
|
||||
@@ -106,7 +118,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
MuiMenuItem: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
borderRadius: "8px",
|
||||
borderRadius: "4px",
|
||||
margin: "0px 4px",
|
||||
paddingLeft: "8px",
|
||||
paddingRight: "8px",
|
||||
@@ -127,7 +139,7 @@ export const applyThemeWithOverrides = (themeConfig: ThemeOptions): ThemeOptions
|
||||
"&:hover:not(.Mui-disabled, .Mui-error):before": {
|
||||
borderBottom: "none",
|
||||
},
|
||||
borderRadius: 12,
|
||||
borderRadius: 4,
|
||||
// '&:hover:not(.Mui-disabled, .Mui-error):before': {
|
||||
// borderBottom: '2px solid var(--TextField-brandBorderHoverColor)',
|
||||
// },
|
||||
@@ -271,7 +283,7 @@ const getPreferredTheme = (
|
||||
|
||||
const StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({
|
||||
"&.notistack-MuiContent": {
|
||||
borderRadius: 12,
|
||||
borderRadius: 4,
|
||||
},
|
||||
"&.notistack-MuiContent-success": {
|
||||
backgroundColor: theme.palette.success.main,
|
||||
@@ -288,6 +300,15 @@ const AppContent = () => {
|
||||
const title = useAppSelector((state) => state.siteConfig.basic.config.title);
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
useEffect(() => {
|
||||
// 显示测试网站提示
|
||||
enqueueSnackbar("请注意,本网站是测试网站", {
|
||||
variant: "warning",
|
||||
autoHideDuration: 5000,
|
||||
});
|
||||
}, [enqueueSnackbar]);
|
||||
const scrollBar = {
|
||||
"&::-webkit-scrollbar-button": {
|
||||
width: 0,
|
||||
|
||||
@@ -64,6 +64,7 @@ const HeadlessFooterPreview = ({ footer, bottom }: { footer?: string; bottom?: s
|
||||
maxHeight: "40px",
|
||||
mb: 2,
|
||||
}}
|
||||
style={{ display: "flex", justifyContent: "center", alignItems: "center" }}
|
||||
/>
|
||||
<div>
|
||||
<Box
|
||||
|
||||
@@ -10,7 +10,7 @@ export const OutlineIconTextField = ({ icon, ...rest }: OutlineIconTextFieldProp
|
||||
return (
|
||||
<TextField
|
||||
{...rest}
|
||||
variant="filled"
|
||||
variant="standard"
|
||||
slotProps={{
|
||||
input: {
|
||||
startAdornment: !isMobile && <InputAdornment position="start">{icon}</InputAdornment>,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Box, Container, Grid, Paper } from "@mui/material";
|
||||
import { Box, Container, Grid, Paper, AppBar, Toolbar, IconButton, Typography, Button } from "@mui/material";
|
||||
import MenuIcon from "@mui/icons-material/Menu";
|
||||
import { Outlet, useNavigation } from "react-router-dom";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks.ts";
|
||||
import AutoHeight from "../Common/AutoHeight.tsx";
|
||||
@@ -40,6 +41,35 @@ const HeadlessFrame = () => {
|
||||
overflow: "auto",
|
||||
}}
|
||||
>
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
<AppBar
|
||||
sx={{
|
||||
backgroundColor: "#f5f5f5",
|
||||
}}
|
||||
>
|
||||
<Toolbar>
|
||||
{/* <IconButton
|
||||
size="large"
|
||||
edge="start"
|
||||
color="inherit"
|
||||
aria-label="menu"
|
||||
sx={{ mr: 2 }}
|
||||
>
|
||||
<MenuIcon />
|
||||
</IconButton> */}
|
||||
{/* <Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
|
||||
News
|
||||
</Typography> */}
|
||||
<Logo
|
||||
sx={{
|
||||
maxWidth: "40%",
|
||||
maxHeight: "40px",
|
||||
mb: 2,
|
||||
}}
|
||||
/>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
</Box>
|
||||
<Container maxWidth={"xs"}>
|
||||
<Grid
|
||||
container
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Box, BoxProps, Typography, useTheme } from "@mui/material";
|
||||
import LogoIcon from "./assets/logo.svg";
|
||||
import LogoIconDark from "./assets/logo_light.svg";
|
||||
import Logo from "../Common/Logo";
|
||||
|
||||
export interface PoweredByProps extends BoxProps {}
|
||||
|
||||
@@ -11,7 +10,6 @@ const PoweredBy = ({ ...rest }: PoweredByProps) => {
|
||||
<Box
|
||||
component="a"
|
||||
marginBottom={2}
|
||||
href="https://cloudreve.org"
|
||||
target="_blank"
|
||||
sx={{
|
||||
width: "100%",
|
||||
@@ -38,16 +36,8 @@ const PoweredBy = ({ ...rest }: PoweredByProps) => {
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
Powered by
|
||||
Powered by Miaostars
|
||||
</Typography>
|
||||
<Box
|
||||
component="img"
|
||||
alt="Cloudreve"
|
||||
sx={{
|
||||
height: 20,
|
||||
}}
|
||||
src={theme.palette.mode === "dark" ? LogoIconDark : LogoIcon}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
|
||||
window.PublicKeyCredential &&
|
||||
PublicKeyCredential.isConditionalMediationAvailable
|
||||
) {
|
||||
PublicKeyCredential.isConditionalMediationAvailable().then((v) => {
|
||||
PublicKeyCredential.isConditionalMediationAvailable().then(() => {
|
||||
if (!abortRef.current.signal.aborted) startLogin(true)();
|
||||
});
|
||||
}
|
||||
@@ -43,12 +43,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
|
||||
|
||||
const startLogin = (conditional: boolean) => async () => {
|
||||
if (!navigator.credentials || !window.PublicKeyCredential) {
|
||||
enqueueSnackbar({
|
||||
message: t("setting.browserNotSupported"),
|
||||
variant: "warning",
|
||||
action: DefaultCloseAction,
|
||||
});
|
||||
|
||||
enqueueSnackbar(t("setting.browserNotSupported"), { variant: "error", action: DefaultCloseAction });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,12 +37,7 @@ const PasskeyList = (props: PasskeyProps) => {
|
||||
const [deleteLoading, setDeleteLoading] = useState(false);
|
||||
const addPasskey = async () => {
|
||||
if (!navigator.credentials || !window.PublicKeyCredential) {
|
||||
enqueueSnackbar({
|
||||
message: t("setting.browserNotSupported"),
|
||||
variant: "warning",
|
||||
action: DefaultCloseAction,
|
||||
});
|
||||
|
||||
dispatch(confirmOperation(t("setting.browserNotSupported")));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user