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
8fcd9332
Commit
8fcd9332
authored
Jan 17, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak timeline styles
parent
1857362d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
+5
-11
ActivityCalendar.tsx
web/src/components/ActivityCalendar.tsx
+1
-1
ChangeMemoCreatedTsDialog.tsx
web/src/components/ChangeMemoCreatedTsDialog.tsx
+1
-7
Timeline.tsx
web/src/pages/Timeline.tsx
+3
-3
No files found.
web/src/components/ActivityCalendar.tsx
View file @
8fcd9332
...
@@ -49,7 +49,7 @@ const ActivityCalendar = (props: Props) => {
...
@@ -49,7 +49,7 @@ const ActivityCalendar = (props: Props) => {
const
date
=
`${year}-${month}-${day}`
;
const
date
=
`${year}-${month}-${day}`
;
const
count
=
data
[
date
]
||
0
;
const
count
=
data
[
date
]
||
0
;
return
day
?
(
return
day
?
(
<
Tooltip
className=
"shrink-0"
key=
{
`${date}-${index}`
}
title=
{
`${count} memos in ${date}`
}
placement=
"top"
>
<
Tooltip
className=
"shrink-0"
key=
{
`${date}-${index}`
}
title=
{
`${count} memos in ${date}`
}
placement=
"top"
arrow
>
<
div
className=
{
classNames
(
"w-3 h-3 rounded flex justify-center items-center"
,
getBgColor
(
count
,
maxCount
))
}
></
div
>
<
div
className=
{
classNames
(
"w-3 h-3 rounded flex justify-center items-center"
,
getBgColor
(
count
,
maxCount
))
}
></
div
>
</
Tooltip
>
</
Tooltip
>
)
:
(
)
:
(
...
...
web/src/components/ChangeMemoCreatedTsDialog.tsx
View file @
8fcd9332
import
{
Button
,
IconButton
,
Input
}
from
"@mui/joy"
;
import
{
Button
,
IconButton
,
Input
}
from
"@mui/joy"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
getNormalizedTimeString
,
getUnixTime
}
from
"@/helpers/datetime"
;
import
{
getNormalizedTimeString
}
from
"@/helpers/datetime"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
useMemoStore
}
from
"@/store/v1"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
generateDialog
}
from
"./Dialog"
;
import
{
generateDialog
}
from
"./Dialog"
;
...
@@ -40,12 +40,6 @@ const ChangeMemoCreatedTsDialog: React.FC<Props> = (props: Props) => {
...
@@ -40,12 +40,6 @@ const ChangeMemoCreatedTsDialog: React.FC<Props> = (props: Props) => {
};
};
const
handleSaveBtnClick
=
async
()
=>
{
const
handleSaveBtnClick
=
async
()
=>
{
const
nowTs
=
getUnixTime
();
if
(
getUnixTime
(
createdAt
)
>
nowTs
)
{
toast
.
error
(
t
(
"message.invalid-created-datetime"
));
return
;
}
try
{
try
{
await
memoStore
.
updateMemo
(
await
memoStore
.
updateMemo
(
{
{
...
...
web/src/pages/Timeline.tsx
View file @
8fcd9332
...
@@ -108,7 +108,7 @@ const Timeline = () => {
...
@@ -108,7 +108,7 @@ const Timeline = () => {
key=
{
group
.
month
}
key=
{
group
.
month
}
className=
{
classNames
(
"flex justify-start items-start w-full mt-2 mb-4"
,
md
?
"flex-row"
:
"flex-col"
)
}
className=
{
classNames
(
"flex justify-start items-start w-full mt-2 mb-4"
,
md
?
"flex-row"
:
"flex-col"
)
}
>
>
<
div
className=
{
classNames
(
"flex shrink-0"
,
md
?
"flex-col w-32 pr-4 pl-
1
pb-8"
:
"flex-row w-full pl-1 mt-2 mb-2"
)
}
>
<
div
className=
{
classNames
(
"flex shrink-0"
,
md
?
"flex-col w-32 pr-4 pl-
2
pb-8"
:
"flex-row w-full pl-1 mt-2 mb-2"
)
}
>
<
div
className=
"w-full flex flex-col mt-2 mb-2"
>
<
div
className=
"w-full flex flex-col mt-2 mb-2"
>
<
span
className=
"font-medium text-4xl leading-none mb-1"
>
<
span
className=
"font-medium text-4xl leading-none mb-1"
>
{
new
Date
(
group
.
month
).
toLocaleString
(
i18n
.
language
,
{
month
:
"short"
})
}
{
new
Date
(
group
.
month
).
toLocaleString
(
i18n
.
language
,
{
month
:
"short"
})
}
...
@@ -122,11 +122,11 @@ const Timeline = () => {
...
@@ -122,11 +122,11 @@ const Timeline = () => {
{
group
.
memos
.
map
((
memo
,
index
)
=>
(
{
group
.
memos
.
map
((
memo
,
index
)
=>
(
<
div
<
div
key=
{
`${memo.id}-${memo.createTime}`
}
key=
{
`${memo.id}-${memo.createTime}`
}
className=
"relative w-full flex flex-col justify-start items-start pl-4 sm:pl-8 pt-0"
className=
{
classNames
(
"relative w-full flex flex-col justify-start items-start pl-4 sm:pl-10 pt-0"
)
}
>
>
<
MemoView
className=
"!border !border-gray-100 dark:!border-zinc-700"
memo=
{
memo
}
/>
<
MemoView
className=
"!border !border-gray-100 dark:!border-zinc-700"
memo=
{
memo
}
/>
{
group
.
memos
.
length
>
1
&&
(
{
group
.
memos
.
length
>
1
&&
(
<
div
className=
"absolute -left-
1
sm:left-2 top-4 h-full"
>
<
div
className=
"absolute -left-
2
sm:left-2 top-4 h-full"
>
{
index
!==
group
.
memos
.
length
-
1
&&
(
{
index
!==
group
.
memos
.
length
-
1
&&
(
<
div
className=
"absolute top-2 left-[7px] h-full w-0.5 bg-gray-200 dark:bg-gray-700 block"
></
div
>
<
div
className=
"absolute top-2 left-[7px] h-full w-0.5 bg-gray-200 dark:bg-gray-700 block"
></
div
>
)
}
)
}
...
...
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