mirror of
https://github.com/usememos/memos.git
synced 2024-09-21 06:55:55 +08:00
chore: add theme file for joyui (#635)
This commit is contained in:
parent
ab8e3473a1
commit
55f37664ef
|
@ -6,6 +6,7 @@ import { locationService } from "./services";
|
|||
import { useAppSelector } from "./store";
|
||||
import router from "./router";
|
||||
import * as storage from "./helpers/storage";
|
||||
import theme from "./theme";
|
||||
|
||||
function App() {
|
||||
const { i18n } = useTranslation();
|
||||
|
@ -41,7 +42,7 @@ function App() {
|
|||
}, [locale]);
|
||||
|
||||
return (
|
||||
<CssVarsProvider>
|
||||
<CssVarsProvider theme={theme}>
|
||||
<RouterProvider router={router} />
|
||||
</CssVarsProvider>
|
||||
);
|
||||
|
|
|
@ -21,7 +21,7 @@ const ApperanceSelect = () => {
|
|||
|
||||
return (
|
||||
<Select
|
||||
className="!min-w-[12rem] w-auto text-sm"
|
||||
className="!min-w-[10rem] w-auto text-sm"
|
||||
value={apperance}
|
||||
onChange={(_, value) => {
|
||||
setApperance(value as Apperance);
|
||||
|
|
|
@ -34,7 +34,7 @@ const SearchBar = () => {
|
|||
<div className="search-bar-container">
|
||||
<div className="search-bar-inputer">
|
||||
<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 className="quickly-action-wrapper">
|
||||
<div className="quickly-action-container">
|
||||
|
|
|
@ -63,7 +63,6 @@ const UserBanner = () => {
|
|||
};
|
||||
|
||||
const handleSignOutBtnClick = async () => {
|
||||
userService.doSignOut().catch();
|
||||
navigate("/auth");
|
||||
};
|
||||
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
|
||||
&:hover,
|
||||
&:active {
|
||||
> .search-bar-inputer > .text-input {
|
||||
@apply flex;
|
||||
}
|
||||
|
||||
> .quickly-action-wrapper {
|
||||
@apply flex;
|
||||
}
|
||||
|
@ -20,7 +16,7 @@
|
|||
}
|
||||
|
||||
> .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 { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useAppSelector } from "../store";
|
||||
|
@ -28,6 +28,10 @@ const Auth = () => {
|
|||
const [username, setUsername] = useState(mode === "dev" ? "demohero" : "");
|
||||
const [password, setPassword] = useState(mode === "dev" ? "secret" : "");
|
||||
|
||||
useEffect(() => {
|
||||
userService.doSignOut().catch();
|
||||
}, []);
|
||||
|
||||
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const text = e.target.value as string;
|
||||
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;
|
Loading…
Reference in a new issue