mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: add theme file for joyui (#635)
This commit is contained in:
@ -6,6 +6,7 @@ import { locationService } from "./services";
|
|||||||
import { useAppSelector } from "./store";
|
import { useAppSelector } from "./store";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import * as storage from "./helpers/storage";
|
import * as storage from "./helpers/storage";
|
||||||
|
import theme from "./theme";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
@ -41,7 +42,7 @@ function App() {
|
|||||||
}, [locale]);
|
}, [locale]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CssVarsProvider>
|
<CssVarsProvider theme={theme}>
|
||||||
<RouterProvider router={router} />
|
<RouterProvider router={router} />
|
||||||
</CssVarsProvider>
|
</CssVarsProvider>
|
||||||
);
|
);
|
||||||
|
@ -21,7 +21,7 @@ const ApperanceSelect = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
className="!min-w-[12rem] w-auto text-sm"
|
className="!min-w-[10rem] w-auto text-sm"
|
||||||
value={apperance}
|
value={apperance}
|
||||||
onChange={(_, value) => {
|
onChange={(_, value) => {
|
||||||
setApperance(value as Apperance);
|
setApperance(value as Apperance);
|
||||||
|
@ -34,7 +34,7 @@ const SearchBar = () => {
|
|||||||
<div className="search-bar-container">
|
<div className="search-bar-container">
|
||||||
<div className="search-bar-inputer">
|
<div className="search-bar-inputer">
|
||||||
<Icon.Search className="icon-img" />
|
<Icon.Search className="icon-img" />
|
||||||
<input className="text-input" type="text" placeholder="" value={queryText} onChange={handleTextQueryInput} />
|
<input className="text-input" autoComplete="off" type="text" placeholder="" value={queryText} onChange={handleTextQueryInput} />
|
||||||
</div>
|
</div>
|
||||||
<div className="quickly-action-wrapper">
|
<div className="quickly-action-wrapper">
|
||||||
<div className="quickly-action-container">
|
<div className="quickly-action-container">
|
||||||
|
@ -63,7 +63,6 @@ const UserBanner = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSignOutBtnClick = async () => {
|
const handleSignOutBtnClick = async () => {
|
||||||
userService.doSignOut().catch();
|
|
||||||
navigate("/auth");
|
navigate("/auth");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:active {
|
&:active {
|
||||||
> .search-bar-inputer > .text-input {
|
|
||||||
@apply flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .quickly-action-wrapper {
|
> .quickly-action-wrapper {
|
||||||
@apply flex;
|
@apply flex;
|
||||||
}
|
}
|
||||||
@ -20,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .text-input {
|
> .text-input {
|
||||||
@apply hidden sm:flex ml-2 w-24 grow text-sm outline-none bg-transparent;
|
@apply flex ml-2 w-24 grow text-sm outline-none bg-transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Option, Select } from "@mui/joy";
|
import { Option, Select } from "@mui/joy";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useAppSelector } from "../store";
|
import { useAppSelector } from "../store";
|
||||||
@ -28,6 +28,10 @@ const Auth = () => {
|
|||||||
const [username, setUsername] = useState(mode === "dev" ? "demohero" : "");
|
const [username, setUsername] = useState(mode === "dev" ? "demohero" : "");
|
||||||
const [password, setPassword] = useState(mode === "dev" ? "secret" : "");
|
const [password, setPassword] = useState(mode === "dev" ? "secret" : "");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
userService.doSignOut().catch();
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const text = e.target.value as string;
|
const text = e.target.value as string;
|
||||||
setUsername(text);
|
setUsername(text);
|
||||||
|
15
web/src/theme/index.ts
Normal file
15
web/src/theme/index.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { extendTheme } from "@mui/joy";
|
||||||
|
|
||||||
|
const theme = extendTheme({
|
||||||
|
components: {
|
||||||
|
JoySelect: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
fontSize: "0.875rem",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default theme;
|
Reference in New Issue
Block a user