mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: tweak responsible styles
This commit is contained in:
@ -20,8 +20,7 @@ VALUES
|
|||||||
'#TODO
|
'#TODO
|
||||||
- [x] Take more photos about **🌄 sunset**;
|
- [x] Take more photos about **🌄 sunset**;
|
||||||
- [x] Clean the room;
|
- [x] Clean the room;
|
||||||
- [ ] Read *📖 The Little Prince*;
|
- [ ] Read *📖 The Little Prince*;',
|
||||||
(👆 click to toggle status)',
|
|
||||||
101,
|
101,
|
||||||
'PROTECTED'
|
'PROTECTED'
|
||||||
);
|
);
|
||||||
|
@ -72,7 +72,6 @@ const MemoEditor = (props: Props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
editorRef.current?.setContent(contentCache || "");
|
editorRef.current?.setContent(contentCache || "");
|
||||||
handleEditorFocus();
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
import classNames from "classnames";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { useWindowScroll } from "react-use";
|
||||||
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
||||||
import NavigationDrawer from "./NavigationDrawer";
|
import NavigationDrawer from "./NavigationDrawer";
|
||||||
|
|
||||||
@ -10,9 +12,15 @@ const MobileHeader = (props: Props) => {
|
|||||||
const { children } = props;
|
const { children } = props;
|
||||||
const { sm } = useResponsiveWidth();
|
const { sm } = useResponsiveWidth();
|
||||||
const [titleText] = useState("MEMOS");
|
const [titleText] = useState("MEMOS");
|
||||||
|
const { y: offsetTop } = useWindowScroll();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="sticky top-0 pt-4 sm:pt-1 pb-1 mb-1 backdrop-blur flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-2">
|
<div
|
||||||
|
className={classNames(
|
||||||
|
"sticky top-0 pt-4 sm:pt-1 px-4 pb-1 mb-1 backdrop-blur flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-2",
|
||||||
|
offsetTop > 0 && "shadow-md"
|
||||||
|
)}
|
||||||
|
>
|
||||||
<div className="flex flex-row justify-start items-center mr-2 shrink-0 overflow-hidden">
|
<div className="flex flex-row justify-start items-center mr-2 shrink-0 overflow-hidden">
|
||||||
{!sm && <NavigationDrawer />}
|
{!sm && <NavigationDrawer />}
|
||||||
<span
|
<span
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
@apply text-base w-full min-h-full p-0 m-0 bg-zinc-100 dark:bg-zinc-800;
|
@apply text-base w-full min-h-[100svh] p-0 m-0 bg-zinc-100 dark:bg-zinc-800;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
|
@ -13,7 +13,7 @@ function Root() {
|
|||||||
<Navigation />
|
<Navigation />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<main className="w-full sm:px-4 h-auto flex-grow shrink flex flex-col justify-start items-center">
|
<main className="w-full h-auto flex-grow shrink flex flex-col justify-start items-center">
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,8 +30,9 @@ const Archived = () => {
|
|||||||
}, [memos]);
|
}, [memos]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-start sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
{loadingState.isLoading ? (
|
{loadingState.isLoading ? (
|
||||||
<div className="w-full h-32 flex flex-col justify-center items-center">
|
<div className="w-full h-32 flex flex-col justify-center items-center">
|
||||||
<p className="opacity-70">{t("memo.fetching-data")}</p>
|
<p className="opacity-70">{t("memo.fetching-data")}</p>
|
||||||
@ -48,6 +49,7 @@ const Archived = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -54,9 +54,9 @@ const Explore = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-center px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
<div className="relative w-full h-auto flex flex-col justify-start items-start">
|
<div className="relative w-full h-auto flex flex-col justify-start items-start px-4">
|
||||||
<MemoFilter />
|
<MemoFilter />
|
||||||
{sortedMemos.map((memo) => (
|
{sortedMemos.map((memo) => (
|
||||||
<Memo key={memo.id} memo={memo} lazyRendering showCreator showParent />
|
<Memo key={memo.id} memo={memo} lazyRendering showCreator showParent />
|
||||||
|
@ -9,14 +9,16 @@ const Home = () => {
|
|||||||
const { md } = useResponsiveWidth();
|
const { md } = useResponsiveWidth();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full flex flex-row justify-center items-start">
|
<div className="w-full max-w-4xl flex flex-row justify-center items-start">
|
||||||
<div className="w-full px-4 max-w-3xl sm:px-2 sm:pt-4">
|
<div className="w-full sm:pt-4">
|
||||||
<MobileHeader>{!md && <HomeSidebarDrawer />}</MobileHeader>
|
<MobileHeader>{!md && <HomeSidebarDrawer />}</MobileHeader>
|
||||||
|
<div className="w-full px-4 md:pr-2">
|
||||||
<MemoEditor className="mb-2" cacheKey="home-memo-editor" />
|
<MemoEditor className="mb-2" cacheKey="home-memo-editor" />
|
||||||
<MemoList />
|
<MemoList />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{md && (
|
{md && (
|
||||||
<div className="hidden md:block sticky top-0 left-0 w-56">
|
<div className="hidden md:block sticky top-0 left-0 shrink-0 w-56">
|
||||||
<HomeSidebar />
|
<HomeSidebar />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -20,8 +20,9 @@ const Inboxes = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-center px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
||||||
<div className="relative w-full flex flex-row justify-between items-center">
|
<div className="relative w-full flex flex-row justify-between items-center">
|
||||||
<p className="px-2 py-1 flex flex-row justify-start items-center select-none opacity-80">
|
<p className="px-2 py-1 flex flex-row justify-start items-center select-none opacity-80">
|
||||||
@ -47,6 +48,7 @@ const Inboxes = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -110,8 +110,9 @@ const MemoDetail = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-center px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
<div className="relative flex-grow w-full min-h-full flex flex-col justify-start items-start border dark:border-zinc-700 bg-white dark:bg-zinc-700 shadow hover:shadow-xl transition-all p-4 pb-3 rounded-lg">
|
<div className="relative flex-grow w-full min-h-full flex flex-col justify-start items-start border dark:border-zinc-700 bg-white dark:bg-zinc-700 shadow hover:shadow-xl transition-all p-4 pb-3 rounded-lg">
|
||||||
{memo.parent && (
|
{memo.parent && (
|
||||||
<div className="w-auto mb-2">
|
<div className="w-auto mb-2">
|
||||||
@ -220,6 +221,7 @@ const MemoDetail = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -66,8 +66,9 @@ const Resources = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-center px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
||||||
<div className="relative w-full flex flex-row justify-between items-center">
|
<div className="relative w-full flex flex-row justify-between items-center">
|
||||||
<p className="px-2 py-1 flex flex-row justify-start items-center select-none opacity-80">
|
<p className="px-2 py-1 flex flex-row justify-start items-center select-none opacity-80">
|
||||||
@ -168,6 +169,7 @@ const Resources = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -42,8 +42,9 @@ const Setting = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-start sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
<div className="setting-page-wrapper">
|
<div className="setting-page-wrapper">
|
||||||
<div className="section-selector-container">
|
<div className="section-selector-container">
|
||||||
<span className="section-title">{t("common.basic")}</span>
|
<span className="section-title">{t("common.basic")}</span>
|
||||||
@ -120,6 +121,7 @@ const Setting = () => {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -104,7 +104,7 @@ const SignIn = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pt-12 pb-8 w-80 max-w-full h-auto mx-auto flex flex-col justify-start items-center">
|
<div className="py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
||||||
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
||||||
<div className="w-full flex flex-row justify-center items-center mb-6">
|
<div className="w-full flex flex-row justify-center items-center mb-6">
|
||||||
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
||||||
|
@ -70,7 +70,7 @@ const SignUp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pt-12 pb-8 w-80 max-w-full h-auto mx-auto flex flex-col justify-start items-center">
|
<div className="py-8 w-80 max-w-full min-h-[100svh] mx-auto flex flex-col justify-start items-center">
|
||||||
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
||||||
<div className="w-full flex flex-row justify-center items-center mb-6">
|
<div className="w-full flex flex-row justify-center items-center mb-6">
|
||||||
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
<img className="h-14 w-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
||||||
|
@ -64,8 +64,9 @@ const Timeline = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="@container w-full max-w-3xl min-h-full flex flex-col justify-start items-center px-4 sm:px-2 sm:pt-4 pb-8">
|
<section className="@container w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
|
<div className="w-full px-4">
|
||||||
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
<div className="w-full shadow flex flex-col justify-start items-start px-4 py-3 rounded-xl bg-white dark:bg-zinc-700 text-black dark:text-gray-300">
|
||||||
<div className="relative w-full flex flex-row justify-start items-center">
|
<div className="relative w-full flex flex-row justify-start items-center">
|
||||||
<p
|
<p
|
||||||
@ -134,6 +135,7 @@ const Timeline = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -35,28 +35,20 @@ const UserProfile = () => {
|
|||||||
}, [params.username]);
|
}, [params.username]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="relative top-0 w-full min-h-full overflow-x-hidden">
|
<section className="w-full max-w-4xl min-h-full flex flex-col justify-start items-center sm:pt-4 pb-8">
|
||||||
<MobileHeader />
|
<MobileHeader />
|
||||||
<div className="relative w-full min-h-full mx-auto flex flex-col justify-start items-center">
|
<div className="w-full px-4 flex flex-col justify-start items-center">
|
||||||
{!loadingState.isLoading &&
|
{!loadingState.isLoading &&
|
||||||
(user ? (
|
(user ? (
|
||||||
<>
|
<>
|
||||||
<div className="relative flex-grow max-w-2xl w-full min-h-full flex flex-col justify-start items-start px-4">
|
|
||||||
<div className="w-full flex flex-row justify-start items-start">
|
|
||||||
<div className="flex-grow shrink w-full">
|
|
||||||
<div className="w-full flex flex-col justify-start items-center py-8">
|
<div className="w-full flex flex-col justify-start items-center py-8">
|
||||||
<UserAvatar className="!w-20 !h-20 mb-2 drop-shadow" avatarUrl={user?.avatarUrl} />
|
<UserAvatar className="!w-20 !h-20 mb-2 drop-shadow" avatarUrl={user?.avatarUrl} />
|
||||||
<p className="text-3xl text-black opacity-80 dark:text-gray-200">{user?.nickname}</p>
|
<p className="text-3xl text-black opacity-80 dark:text-gray-200">{user?.nickname}</p>
|
||||||
</div>
|
</div>
|
||||||
<MemoList />
|
<MemoList />
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
|
||||||
<p>Not found</p>
|
<p>Not found</p>
|
||||||
</>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
Reference in New Issue
Block a user