Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
d6656db2
Commit
d6656db2
authored
Dec 18, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: implement part of full-screen layout
parent
15a091fe
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
116 additions
and
255 deletions
+116
-255
App.tsx
web/src/App.tsx
+3
-3
EmbedMemoDialog.tsx
web/src/components/EmbedMemoDialog.tsx
+0
-62
MobileHeader.tsx
web/src/components/MobileHeader.tsx
+1
-1
Navigation.tsx
web/src/components/Navigation.tsx
+2
-2
ShareMemoDialog.tsx
web/src/components/ShareMemoDialog.tsx
+0
-9
UserBanner.tsx
web/src/components/UserBanner.tsx
+1
-1
global.css
web/src/css/global.css
+2
-2
Root.tsx
web/src/layouts/Root.tsx
+11
-6
Archived.tsx
web/src/pages/Archived.tsx
+1
-1
DailyReview.tsx
web/src/pages/DailyReview.tsx
+1
-1
EmbedMemo.tsx
web/src/pages/EmbedMemo.tsx
+0
-62
Explore.tsx
web/src/pages/Explore.tsx
+1
-1
Home.tsx
web/src/pages/Home.tsx
+2
-2
Inboxes.tsx
web/src/pages/Inboxes.tsx
+1
-1
Loading.tsx
web/src/pages/Loading.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+73
-79
NotFound.tsx
web/src/pages/NotFound.tsx
+1
-1
Resources.tsx
web/src/pages/Resources.tsx
+1
-1
Setting.tsx
web/src/pages/Setting.tsx
+1
-1
UserProfile.tsx
web/src/pages/UserProfile.tsx
+1
-1
index.tsx
web/src/router/index.tsx
+12
-17
No files found.
web/src/App.tsx
View file @
d6656db2
...
@@ -12,8 +12,8 @@ import { useUserV1Store } from "./store/v1";
...
@@ -12,8 +12,8 @@ import { useUserV1Store } from "./store/v1";
const
App
=
()
=>
{
const
App
=
()
=>
{
const
{
i18n
}
=
useTranslation
();
const
{
i18n
}
=
useTranslation
();
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
const
globalStore
=
useGlobalStore
();
const
{
mode
,
setMode
}
=
useColorScheme
();
const
{
mode
,
setMode
}
=
useColorScheme
();
const
globalStore
=
useGlobalStore
();
const
userV1Store
=
useUserV1Store
();
const
userV1Store
=
useUserV1Store
();
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
{
appearance
,
locale
,
systemStatus
}
=
globalStore
.
state
;
const
{
appearance
,
locale
,
systemStatus
}
=
globalStore
.
state
;
...
@@ -30,7 +30,7 @@ const App = () => {
...
@@ -30,7 +30,7 @@ const App = () => {
try
{
try
{
await
userV1Store
.
fetchCurrentUser
();
await
userV1Store
.
fetchCurrentUser
();
}
catch
(
error
)
{
}
catch
(
error
)
{
//
Skip
.
//
Do nothing
.
}
}
setLoading
(
false
);
setLoading
(
false
);
};
};
...
@@ -75,8 +75,8 @@ const App = () => {
...
@@ -75,8 +75,8 @@ const App = () => {
}
}
},
[
systemStatus
.
additionalScript
]);
},
[
systemStatus
.
additionalScript
]);
// Dynamic update metadata with customized profile.
useEffect
(()
=>
{
useEffect
(()
=>
{
// dynamic update metadata with customized profile.
document
.
title
=
systemStatus
.
customizedProfile
.
name
;
document
.
title
=
systemStatus
.
customizedProfile
.
name
;
const
link
=
document
.
querySelector
(
"link[rel~='icon']"
)
as
HTMLLinkElement
;
const
link
=
document
.
querySelector
(
"link[rel~='icon']"
)
as
HTMLLinkElement
;
link
.
href
=
systemStatus
.
customizedProfile
.
logoUrl
||
"/logo.png"
;
link
.
href
=
systemStatus
.
customizedProfile
.
logoUrl
||
"/logo.png"
;
...
...
web/src/components/EmbedMemoDialog.tsx
deleted
100644 → 0
View file @
15a091fe
import
copy
from
"copy-to-clipboard"
;
import
React
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
Icon
from
"./Icon"
;
interface
Props
extends
DialogProps
{
memoId
:
MemoId
;
}
const
EmbedMemoDialog
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
t
=
useTranslate
();
const
{
memoId
,
destroy
}
=
props
;
const
memoEmbeddedCode
=
()
=>
{
return
`<iframe style="width:100%;height:auto;min-width:256px;" src="
${
window
.
location
.
origin
}
/m/
${
memoId
}
/embed" frameBorder="0"></iframe>`
;
};
const
handleCopyCode
=
()
=>
{
copy
(
memoEmbeddedCode
());
toast
.
success
(
"Succeed to copy code to clipboard."
);
};
return
(
<>
<
div
className=
"dialog-header-container"
>
<
p
className=
"title-text"
>
{
t
(
"embed-memo.title"
)
}
</
p
>
<
button
className=
"btn close-btn"
onClick=
{
()
=>
destroy
()
}
>
<
Icon
.
X
/>
</
button
>
</
div
>
<
div
className=
"dialog-content-container !w-80"
>
<
p
className=
"text-base leading-6 mb-2"
>
{
t
(
"embed-memo.text"
)
}
</
p
>
<
pre
className=
"w-full font-mono text-sm p-3 border rounded-lg"
>
<
code
className=
"w-full break-all whitespace-pre-wrap"
>
{
memoEmbeddedCode
()
}
</
code
>
</
pre
>
<
p
className=
"w-full text-sm leading-6 flex flex-row justify-between items-center mt-2"
>
<
span
className=
"italic opacity-80"
>
{
t
(
"embed-memo.only-public-supported"
)
}
</
span
>
<
span
className=
"btn-primary"
onClick=
{
handleCopyCode
}
>
{
t
(
"embed-memo.copy"
)
}
</
span
>
</
p
>
</
div
>
</>
);
};
function
showEmbedMemoDialog
(
memoId
:
MemoId
)
{
generateDialog
(
{
className
:
"embed-memo-dialog"
,
dialogName
:
"embed-memo-dialog"
,
},
EmbedMemoDialog
,
{
memoId
,
}
);
}
export
default
showEmbedMemoDialog
;
web/src/components/MobileHeader.tsx
View file @
d6656db2
...
@@ -12,7 +12,7 @@ const MobileHeader = (props: Props) => {
...
@@ -12,7 +12,7 @@ const MobileHeader = (props: Props) => {
const
[
titleText
]
=
useState
(
"MEMOS"
);
const
[
titleText
]
=
useState
(
"MEMOS"
);
return
(
return
(
<
div
className=
"sticky top-0 pt-4 sm:pt-1 pb-1 mb-1 backdrop-blur
bg-zinc-100 dark:bg-zinc-800 bg-opacity-70
flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-2"
>
<
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=
"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
...
...
web/src/components/Navigation.tsx
View file @
d6656db2
...
@@ -72,7 +72,7 @@ const Navigation = () => {
...
@@ -72,7 +72,7 @@ const Navigation = () => {
id
:
"header-explore"
,
id
:
"header-explore"
,
path
:
"/explore"
,
path
:
"/explore"
,
title
:
t
(
"common.explore"
),
title
:
t
(
"common.explore"
),
icon
:
<
Icon
.
Hash
className=
"mr-3 w-6 h-auto opacity-70"
/>,
icon
:
<
Icon
.
Globe2
className=
"mr-3 w-6 h-auto opacity-70"
/>,
};
};
const
archivedNavLink
:
NavLinkItem
=
{
const
archivedNavLink
:
NavLinkItem
=
{
id
:
"header-archived"
,
id
:
"header-archived"
,
...
@@ -108,7 +108,7 @@ const Navigation = () => {
...
@@ -108,7 +108,7 @@ const Navigation = () => {
id=
{
navLink
.
id
}
id=
{
navLink
.
id
}
className=
{
({
isActive
})
=>
className=
{
({
isActive
})
=>
classNames
(
classNames
(
"px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-600 dark:hover:bg-zinc-700"
,
"
w-full
px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-600 dark:hover:bg-zinc-700"
,
isActive
?
"bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600"
:
"border-transparent"
isActive
?
"bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600"
:
"border-transparent"
)
)
}
}
...
...
web/src/components/ShareMemoDialog.tsx
View file @
d6656db2
...
@@ -8,7 +8,6 @@ import toImage from "@/labs/html2image";
...
@@ -8,7 +8,6 @@ import toImage from "@/labs/html2image";
import
{
useUserV1Store
,
extractUsernameFromName
}
from
"@/store/v1"
;
import
{
useUserV1Store
,
extractUsernameFromName
}
from
"@/store/v1"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
showEmbedMemoDialog
from
"./EmbedMemoDialog"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
MemoContentV1
from
"./MemoContentV1"
;
import
MemoContentV1
from
"./MemoContentV1"
;
import
MemoResourceListView
from
"./MemoResourceListView"
;
import
MemoResourceListView
from
"./MemoResourceListView"
;
...
@@ -65,10 +64,6 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
...
@@ -65,10 +64,6 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
});
});
};
};
const
handleShowEmbedMemoDialog
=
()
=>
{
showEmbedMemoDialog
(
memo
.
id
);
};
const
handleCopyLinkBtnClick
=
()
=>
{
const
handleCopyLinkBtnClick
=
()
=>
{
copy
(
`
${
window
.
location
.
origin
}
/m/
${
memo
.
id
}
`
);
copy
(
`
${
window
.
location
.
origin
}
/m/
${
memo
.
id
}
`
);
toast
.
success
(
t
(
"message.succeed-copy-link"
));
toast
.
success
(
t
(
"message.succeed-copy-link"
));
...
@@ -96,10 +91,6 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
...
@@ -96,10 +91,6 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
)
}
)
}
{
t
(
"common.image"
)
}
{
t
(
"common.image"
)
}
</
Button
>
</
Button
>
<
Button
color=
"neutral"
variant=
"outlined"
onClick=
{
handleShowEmbedMemoDialog
}
>
<
Icon
.
Code
className=
"w-4 h-auto mr-1"
/>
{
t
(
"memo.embed"
)
}
</
Button
>
<
Button
color=
"neutral"
variant=
"outlined"
onClick=
{
handleCopyLinkBtnClick
}
>
<
Button
color=
"neutral"
variant=
"outlined"
onClick=
{
handleCopyLinkBtnClick
}
>
<
Icon
.
Link
className=
"w-4 h-auto mr-1"
/>
<
Icon
.
Link
className=
"w-4 h-auto mr-1"
/>
{
t
(
"common.link"
)
}
{
t
(
"common.link"
)
}
...
...
web/src/components/UserBanner.tsx
View file @
d6656db2
...
@@ -16,7 +16,7 @@ const UserBanner = () => {
...
@@ -16,7 +16,7 @@ const UserBanner = () => {
const
globalStore
=
useGlobalStore
();
const
globalStore
=
useGlobalStore
();
const
{
systemStatus
}
=
globalStore
.
state
;
const
{
systemStatus
}
=
globalStore
.
state
;
const
user
=
useCurrentUser
();
const
user
=
useCurrentUser
();
const
title
=
user
?
user
.
nickname
:
systemStatus
.
customizedProfile
.
name
||
"memos"
;
const
title
=
user
?
user
.
nickname
||
extractUsernameFromName
(
user
.
name
)
:
systemStatus
.
customizedProfile
.
name
||
"memos"
;
const
handleMyAccountClick
=
()
=>
{
const
handleMyAccountClick
=
()
=>
{
navigateTo
(
`/u/
${
encodeURIComponent
(
extractUsernameFromName
(
user
.
name
))}
`
);
navigateTo
(
`/u/
${
encodeURIComponent
(
extractUsernameFromName
(
user
.
name
))}
`
);
...
...
web/src/css/global.css
View file @
d6656db2
html
,
html
,
body
{
body
{
@apply
text-base
w-full
h-full
overflow-hidden
dark
:
bg-zinc-800
;
@apply
text-base
w-full
min-h-full
bg-zinc-100
dark
:
bg-zinc-800
;
}
}
#root
{
#root
{
@apply
w-full
h-
full
overflow-auto;
@apply
w-full
h-
auto
overflow-auto;
}
}
web/src/layouts/Root.tsx
View file @
d6656db2
import
{
Outlet
}
from
"react-router-dom"
;
import
{
Outlet
}
from
"react-router-dom"
;
import
DemoBanner
from
"@/components/DemoBanner"
;
import
DemoBanner
from
"@/components/DemoBanner"
;
import
Navigation
from
"@/components/Navigation"
;
import
Navigation
from
"@/components/Navigation"
;
import
useResponsiveWidth
from
"@/hooks/useResponsiveWidth"
;
function
Root
()
{
function
Root
()
{
const
{
sm
}
=
useResponsiveWidth
();
return
(
return
(
<
div
className=
"w-full min-h-full
bg-zinc-100 dark:bg-zinc-800
"
>
<
div
className=
"w-full min-h-full"
>
<
div
className=
"w-full h-auto flex flex-col justify-start items-center"
>
<
div
className=
"w-full h-auto flex flex-col justify-start items-center"
>
<
DemoBanner
/>
<
DemoBanner
/>
</
div
>
</
div
>
<
div
className=
"w-full max-w-6xl mx-auto flex flex-row justify-center items-start sm:px-4"
>
<
div
className=
"w-full sm:pl-56 mx-auto flex flex-row justify-center items-start"
>
<
div
className=
"hidden sm:block sticky top-0 left-0 w-56"
>
{
sm
&&
(
<
div
className=
"hidden sm:block fixed top-0 left-0 w-56 border-r dark:border-zinc-800 h-full bg-zinc-50 dark:bg-zinc-700 dark:bg-opacity-40 transition-all hover:shadow-xl"
>
<
Navigation
/>
<
Navigation
/>
</
div
>
</
div
>
<
main
className=
"w-full min-h-screen sm:max-w-[calc(100%-14rem)] flex-grow shrink flex flex-col justify-start items-start"
>
)
}
<
main
className=
"w-full sm:px-4 min-h-screen flex-grow shrink flex flex-col justify-start items-center"
>
<
Outlet
/>
<
Outlet
/>
</
main
>
</
main
>
</
div
>
</
div
>
...
...
web/src/pages/Archived.tsx
View file @
d6656db2
...
@@ -35,7 +35,7 @@ const Archived = () => {
...
@@ -35,7 +35,7 @@ const Archived = () => {
},
[
memos
,
textQuery
]);
},
[
memos
,
textQuery
]);
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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
MemoFilter
/>
<
MemoFilter
/>
{
loadingState
.
isLoading
?
(
{
loadingState
.
isLoading
?
(
...
...
web/src/pages/DailyReview.tsx
View file @
d6656db2
...
@@ -64,7 +64,7 @@ const DailyReview = () => {
...
@@ -64,7 +64,7 @@ const DailyReview = () => {
};
};
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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
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"
>
...
...
web/src/pages/EmbedMemo.tsx
deleted
100644 → 0
View file @
15a091fe
import
{
useEffect
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useParams
}
from
"react-router-dom"
;
import
MemoContentV1
from
"@/components/MemoContentV1"
;
import
MemoResourceListView
from
"@/components/MemoResourceListView"
;
import
{
UNKNOWN_ID
}
from
"@/helpers/consts"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
useLoading
from
"@/hooks/useLoading"
;
import
{
useMemoStore
}
from
"@/store/module"
;
interface
State
{
memo
:
Memo
;
}
const
EmbedMemo
=
()
=>
{
const
params
=
useParams
();
const
memoStore
=
useMemoStore
();
const
[
state
,
setState
]
=
useState
<
State
>
({
memo
:
{
id
:
UNKNOWN_ID
,
}
as
Memo
,
});
const
loadingState
=
useLoading
();
useEffect
(()
=>
{
const
memoId
=
Number
(
params
.
memoId
);
if
(
memoId
&&
!
isNaN
(
memoId
))
{
memoStore
.
fetchMemoById
(
memoId
)
.
then
((
memo
)
=>
{
setState
({
memo
,
});
loadingState
.
setFinish
();
})
.
catch
((
error
)
=>
{
toast
.
error
(
error
.
response
.
data
.
message
);
});
}
},
[]);
return
(
<
section
className=
"w-full h-full flex flex-row justify-start items-start p-2"
>
{
!
loadingState
.
isLoading
&&
(
<
div
className=
"w-full max-w-lg mx-auto my-auto shadow px-4 py-4 rounded-lg"
>
<
div
className=
"w-full flex flex-col justify-start items-start"
>
<
div
className=
"w-full mb-2 flex flex-row justify-start items-center text-sm text-gray-400 dark:text-gray-300"
>
<
span
>
{
getDateTimeString
(
state
.
memo
.
displayTs
)
}
</
span
>
<
a
className=
"ml-2 hover:underline hover:text-green-600"
href=
{
`/u/${state.memo.creatorUsername}`
}
>
@
{
state
.
memo
.
creatorName
}
</
a
>
</
div
>
<
MemoContentV1
className=
"memo-content"
content=
{
state
.
memo
.
content
}
onMemoContentClick=
{
()
=>
undefined
}
/>
<
MemoResourceListView
resourceList=
{
state
.
memo
.
resourceList
}
/>
</
div
>
</
div
>
)
}
</
section
>
);
};
export
default
EmbedMemo
;
web/src/pages/Explore.tsx
View file @
d6656db2
...
@@ -54,7 +54,7 @@ const Explore = () => {
...
@@ -54,7 +54,7 @@ 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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
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"
>
<
MemoFilter
/>
<
MemoFilter
/>
...
...
web/src/pages/Home.tsx
View file @
d6656db2
...
@@ -8,8 +8,8 @@ import useResponsiveWidth from "@/hooks/useResponsiveWidth";
...
@@ -8,8 +8,8 @@ import useResponsiveWidth from "@/hooks/useResponsiveWidth";
const
Home
=
()
=>
{
const
Home
=
()
=>
{
const
{
md
}
=
useResponsiveWidth
();
const
{
md
}
=
useResponsiveWidth
();
return
(
return
(
<
div
className=
"w-full flex flex-row justify-
start
items-start"
>
<
div
className=
"w-full flex flex-row justify-
center
items-start"
>
<
div
className=
"w-full px-4 m
d:max-w-[calc(100%-14rem)]
sm:px-2 sm:pt-4"
>
<
div
className=
"w-full px-4 m
ax-w-3xl
sm:px-2 sm:pt-4"
>
<
MobileHeader
>
{
!
md
&&
<
HomeSidebarDrawer
/>
}
</
MobileHeader
>
<
MobileHeader
>
{
!
md
&&
<
HomeSidebarDrawer
/>
}
</
MobileHeader
>
<
MemoEditor
className=
"mb-2"
cacheKey=
"home-memo-editor"
/>
<
MemoEditor
className=
"mb-2"
cacheKey=
"home-memo-editor"
/>
<
MemoList
/>
<
MemoList
/>
...
...
web/src/pages/Inboxes.tsx
View file @
d6656db2
...
@@ -20,7 +20,7 @@ const Inboxes = () => {
...
@@ -20,7 +20,7 @@ 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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
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"
>
...
...
web/src/pages/Loading.tsx
View file @
d6656db2
...
@@ -2,7 +2,7 @@ import Icon from "@/components/Icon";
...
@@ -2,7 +2,7 @@ import Icon from "@/components/Icon";
function
Loading
()
{
function
Loading
()
{
return
(
return
(
<
div
className=
"flex flex-row justify-center items-center w-full h-full
bg-zinc-100 dark:bg-zinc-800
"
>
<
div
className=
"flex flex-row justify-center items-center w-full h-full"
>
<
div
className=
"w-80 max-w-full h-full py-4 flex flex-col justify-center items-center"
>
<
div
className=
"w-80 max-w-full h-full py-4 flex flex-col justify-center items-center"
>
<
Icon
.
Loader
className=
"animate-spin dark:text-gray-200"
/>
<
Icon
.
Loader
className=
"animate-spin dark:text-gray-200"
/>
</
div
>
</
div
>
...
...
web/src/pages/MemoDetail.tsx
View file @
d6656db2
...
@@ -111,15 +111,10 @@ const MemoDetail = () => {
...
@@ -111,15 +111,10 @@ const MemoDetail = () => {
return
(
return
(
<>
<>
<
section
className=
"relative top-0 w-full min-h-full overflow-x-hidden bg-zinc-100 dark:bg-zinc-900"
>
<
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"
>
<
div
className=
"relative w-full h-auto mx-auto flex flex-col justify-start items-center bg-white dark:bg-zinc-700"
>
<
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=
"w-full flex flex-col justify-start items-center pt-16 pb-8"
>
<
UserAvatar
className=
"!w-20 !h-20 mb-2 drop-shadow"
avatarUrl=
{
systemStatus
.
customizedProfile
.
logoUrl
}
/>
<
p
className=
"text-3xl text-black opacity-80 dark:text-gray-200"
>
{
systemStatus
.
customizedProfile
.
name
}
</
p
>
</
div
>
<
div
className=
"relative flex-grow max-w-2xl w-full min-h-full flex flex-col justify-start items-start px-4 pb-6"
>
{
memo
.
parent
&&
(
{
memo
.
parent
&&
(
<
div
className=
"w-auto mb-4
"
>
<
div
className=
"w-auto mb-2
"
>
<
Link
<
Link
className=
"px-3 py-1 border rounded-full max-w-xs w-auto text-sm flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-400 dark:border-gray-500 hover:shadow hover:opacity-80"
className=
"px-3 py-1 border rounded-full max-w-xs w-auto text-sm flex flex-row justify-start items-center flex-nowrap text-gray-600 dark:text-gray-400 dark:border-gray-500 hover:shadow hover:opacity-80"
to=
{
`/m/${memo.parent.id}`
}
to=
{
`/m/${memo.parent.id}`
}
...
@@ -130,7 +125,7 @@ const MemoDetail = () => {
...
@@ -130,7 +125,7 @@ const MemoDetail = () => {
</
Link
>
</
Link
>
</
div
>
</
div
>
)
}
)
}
<
div
className=
"w-full mb-4 flex flex-row justify-start items-center mr-1
"
>
<
div
className=
"w-full mb-2 flex flex-row justify-start items-center
"
>
<
span
className=
"text-gray-400 select-none"
>
{
getDateTimeString
(
memo
.
displayTs
)
}
</
span
>
<
span
className=
"text-gray-400 select-none"
>
{
getDateTimeString
(
memo
.
displayTs
)
}
</
span
>
</
div
>
</
div
>
<
MemoContentV1
content=
{
memo
.
content
}
/>
<
MemoContentV1
content=
{
memo
.
content
}
/>
...
@@ -194,9 +189,8 @@ const MemoDetail = () => {
...
@@ -194,9 +189,8 @@ const MemoDetail = () => {
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"pt-8 pb-16 w-full"
>
<
div
className=
"pt-8 pb-16 w-full border-t dark:border-t-zinc-700"
>
<
div
className=
"relative mx-auto flex-grow w-full min-h-full flex flex-col justify-start items-start gap-y-1"
>
<
div
className=
"relative mx-auto flex-grow max-w-2xl w-full min-h-full flex flex-col justify-start items-start px-4 gap-y-1"
>
{
comments
.
length
===
0
?
(
{
comments
.
length
===
0
?
(
<
div
className=
"w-full flex flex-col justify-center items-center py-6 mb-2"
>
<
div
className=
"w-full flex flex-col justify-center items-center py-6 mb-2"
>
<
Icon
.
MessageCircle
strokeWidth=
{
1
}
className=
"w-8 h-auto text-gray-400"
/>
<
Icon
.
MessageCircle
strokeWidth=
{
1
}
className=
"w-8 h-auto text-gray-400"
/>
...
...
web/src/pages/NotFound.tsx
View file @
d6656db2
...
@@ -7,7 +7,7 @@ const NotFound = () => {
...
@@ -7,7 +7,7 @@ const NotFound = () => {
const
t
=
useTranslate
();
const
t
=
useTranslate
();
return
(
return
(
<
div
className=
"w-full h-full overflow-y-auto overflow-x-hidden
bg-zinc-100 dark:bg-zinc-800
"
>
<
div
className=
"w-full h-full overflow-y-auto overflow-x-hidden"
>
<
div
className=
"w-full h-full flex flex-col justify-center items-center"
>
<
div
className=
"w-full h-full flex flex-col justify-center items-center"
>
<
Icon
.
Meh
strokeWidth=
{
1
}
className=
"w-20 h-auto opacity-80 dark:text-gray-300"
/>
<
Icon
.
Meh
strokeWidth=
{
1
}
className=
"w-20 h-auto opacity-80 dark:text-gray-300"
/>
<
p
className=
"mt-4 text-5xl font-mono dark:text-gray-300"
>
404
</
p
>
<
p
className=
"mt-4 text-5xl font-mono dark:text-gray-300"
>
404
</
p
>
...
...
web/src/pages/Resources.tsx
View file @
d6656db2
...
@@ -66,7 +66,7 @@ const Resources = () => {
...
@@ -66,7 +66,7 @@ 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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
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"
>
...
...
web/src/pages/Setting.tsx
View file @
d6656db2
...
@@ -42,7 +42,7 @@ const Setting = () => {
...
@@ -42,7 +42,7 @@ 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
bg-zinc-100 dark:bg-zinc-800
"
>
<
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"
>
<
MobileHeader
/>
<
MobileHeader
/>
<
div
className=
"setting-page-wrapper"
>
<
div
className=
"setting-page-wrapper"
>
<
div
className=
"section-selector-container"
>
<
div
className=
"section-selector-container"
>
...
...
web/src/pages/UserProfile.tsx
View file @
d6656db2
...
@@ -36,7 +36,7 @@ const UserProfile = () => {
...
@@ -36,7 +36,7 @@ const UserProfile = () => {
return
(
return
(
<>
<>
<
section
className=
"relative top-0 w-full min-h-full overflow-x-hidden
bg-zinc-100 dark:bg-zinc-800
"
>
<
section
className=
"relative top-0 w-full min-h-full overflow-x-hidden"
>
<
div
className=
"relative w-full min-h-full mx-auto flex flex-col justify-start items-center"
>
<
div
className=
"relative w-full min-h-full mx-auto flex flex-col justify-start items-center"
>
{
!
loadingState
.
isLoading
&&
{
!
loadingState
.
isLoading
&&
(
user
?
(
(
user
?
(
...
...
web/src/router/index.tsx
View file @
d6656db2
...
@@ -12,7 +12,6 @@ const Explore = lazy(() => import("@/pages/Explore"));
...
@@ -12,7 +12,6 @@ const Explore = lazy(() => import("@/pages/Explore"));
const
Home
=
lazy
(()
=>
import
(
"@/pages/Home"
));
const
Home
=
lazy
(()
=>
import
(
"@/pages/Home"
));
const
UserProfile
=
lazy
(()
=>
import
(
"@/pages/UserProfile"
));
const
UserProfile
=
lazy
(()
=>
import
(
"@/pages/UserProfile"
));
const
MemoDetail
=
lazy
(()
=>
import
(
"@/pages/MemoDetail"
));
const
MemoDetail
=
lazy
(()
=>
import
(
"@/pages/MemoDetail"
));
const
EmbedMemo
=
lazy
(()
=>
import
(
"@/pages/EmbedMemo"
));
const
Archived
=
lazy
(()
=>
import
(
"@/pages/Archived"
));
const
Archived
=
lazy
(()
=>
import
(
"@/pages/Archived"
));
const
DailyReview
=
lazy
(()
=>
import
(
"@/pages/DailyReview"
));
const
DailyReview
=
lazy
(()
=>
import
(
"@/pages/DailyReview"
));
const
Resources
=
lazy
(()
=>
import
(
"@/pages/Resources"
));
const
Resources
=
lazy
(()
=>
import
(
"@/pages/Resources"
));
...
@@ -103,18 +102,12 @@ const router = createBrowserRouter([
...
@@ -103,18 +102,12 @@ const router = createBrowserRouter([
path
:
"explore"
,
path
:
"explore"
,
element
:
<
Explore
/>,
element
:
<
Explore
/>,
},
},
],
},
{
{
path
:
"/
m/:memoId"
,
path
:
"
m/:memoId"
,
element
:
<
MemoDetail
/>,
element
:
<
MemoDetail
/>,
},
},
{
{
path
:
"/m/:memoId/embed"
,
path
:
"u/:username"
,
element
:
<
EmbedMemo
/>,
},
{
path
:
"/u/:username"
,
element
:
<
UserProfile
/>,
element
:
<
UserProfile
/>,
},
},
{
{
...
@@ -123,6 +116,8 @@ const router = createBrowserRouter([
...
@@ -123,6 +116,8 @@ const router = createBrowserRouter([
},
},
],
],
},
},
],
},
]);
]);
export
default
router
;
export
default
router
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment