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
a50f3b93
Commit
a50f3b93
authored
Jul 27, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix memos sorting
parent
5ad00c3a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
Archived.tsx
web/src/pages/Archived.tsx
+4
-1
Explore.tsx
web/src/pages/Explore.tsx
+2
-1
Home.tsx
web/src/pages/Home.tsx
+2
-0
UserProfile.tsx
web/src/pages/UserProfile.tsx
+4
-1
No files found.
web/src/pages/Archived.tsx
View file @
a50f3b93
import
{
Button
,
Tooltip
}
from
"@mui/joy"
;
import
{
Button
,
Tooltip
}
from
"@mui/joy"
;
import
dayjs
from
"dayjs"
;
import
{
ClientError
}
from
"nice-grpc-web"
;
import
{
ClientError
}
from
"nice-grpc-web"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
toast
from
"react-hot-toast"
;
import
toast
from
"react-hot-toast"
;
...
@@ -23,7 +24,9 @@ const Archived = () => {
...
@@ -23,7 +24,9 @@ const Archived = () => {
const
memoFilterStore
=
useMemoFilterStore
();
const
memoFilterStore
=
useMemoFilterStore
();
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
sortedMemos
=
memoList
.
value
.
filter
((
memo
)
=>
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
);
const
sortedMemos
=
memoList
.
value
.
filter
((
memo
)
=>
memo
.
rowStatus
===
RowStatus
.
ARCHIVED
)
.
sort
((
a
,
b
)
=>
dayjs
(
b
.
displayTime
).
unix
()
-
dayjs
(
a
.
displayTime
).
unix
());
useEffect
(()
=>
{
useEffect
(()
=>
{
memoList
.
reset
();
memoList
.
reset
();
...
...
web/src/pages/Explore.tsx
View file @
a50f3b93
import
{
Button
}
from
"@mui/joy"
;
import
{
Button
}
from
"@mui/joy"
;
import
clsx
from
"clsx"
;
import
clsx
from
"clsx"
;
import
dayjs
from
"dayjs"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
Empty
from
"@/components/Empty"
;
import
Empty
from
"@/components/Empty"
;
import
{
ExploreSidebar
,
ExploreSidebarDrawer
}
from
"@/components/ExploreSidebar"
;
import
{
ExploreSidebar
,
ExploreSidebarDrawer
}
from
"@/components/ExploreSidebar"
;
...
@@ -22,7 +23,7 @@ const Explore = () => {
...
@@ -22,7 +23,7 @@ const Explore = () => {
const
memoFilterStore
=
useMemoFilterStore
();
const
memoFilterStore
=
useMemoFilterStore
();
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
sortedMemos
=
memoList
.
value
;
const
sortedMemos
=
memoList
.
value
.
sort
((
a
,
b
)
=>
dayjs
(
b
.
displayTime
).
unix
()
-
dayjs
(
a
.
displayTime
).
unix
())
;
useEffect
(()
=>
{
useEffect
(()
=>
{
memoList
.
reset
();
memoList
.
reset
();
...
...
web/src/pages/Home.tsx
View file @
a50f3b93
import
{
Button
}
from
"@mui/joy"
;
import
{
Button
}
from
"@mui/joy"
;
import
clsx
from
"clsx"
;
import
clsx
from
"clsx"
;
import
dayjs
from
"dayjs"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
Empty
from
"@/components/Empty"
;
import
Empty
from
"@/components/Empty"
;
import
{
HomeSidebar
,
HomeSidebarDrawer
}
from
"@/components/HomeSidebar"
;
import
{
HomeSidebar
,
HomeSidebarDrawer
}
from
"@/components/HomeSidebar"
;
...
@@ -26,6 +27,7 @@ const Home = () => {
...
@@ -26,6 +27,7 @@ const Home = () => {
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
sortedMemos
=
memoList
.
value
const
sortedMemos
=
memoList
.
value
.
filter
((
memo
)
=>
memo
.
rowStatus
===
RowStatus
.
ACTIVE
)
.
filter
((
memo
)
=>
memo
.
rowStatus
===
RowStatus
.
ACTIVE
)
.
sort
((
a
,
b
)
=>
dayjs
(
b
.
displayTime
).
unix
()
-
dayjs
(
a
.
displayTime
).
unix
())
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
));
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
));
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
web/src/pages/UserProfile.tsx
View file @
a50f3b93
import
{
Button
}
from
"@mui/joy"
;
import
{
Button
}
from
"@mui/joy"
;
import
copy
from
"copy-to-clipboard"
;
import
copy
from
"copy-to-clipboard"
;
import
dayjs
from
"dayjs"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useParams
}
from
"react-router-dom"
;
import
{
useParams
}
from
"react-router-dom"
;
...
@@ -26,7 +27,9 @@ const UserProfile = () => {
...
@@ -26,7 +27,9 @@ const UserProfile = () => {
const
memoFilterStore
=
useMemoFilterStore
();
const
memoFilterStore
=
useMemoFilterStore
();
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
isRequesting
,
setIsRequesting
]
=
useState
(
true
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
[
nextPageToken
,
setNextPageToken
]
=
useState
<
string
>
(
""
);
const
sortedMemos
=
memoList
.
value
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
));
const
sortedMemos
=
memoList
.
value
.
sort
((
a
,
b
)
=>
dayjs
(
b
.
displayTime
).
unix
()
-
dayjs
(
a
.
displayTime
).
unix
())
.
sort
((
a
,
b
)
=>
Number
(
b
.
pinned
)
-
Number
(
a
.
pinned
));
useEffect
(()
=>
{
useEffect
(()
=>
{
const
username
=
params
.
username
;
const
username
=
params
.
username
;
...
...
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