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
fd99e109
Commit
fd99e109
authored
Jun 01, 2025
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak sidebar
parent
2595e32f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
38 deletions
+49
-38
DateTimeInput.tsx
web/src/components/DateTimeInput.tsx
+25
-28
HomeSidebar.tsx
web/src/components/HomeSidebar/HomeSidebar.tsx
+1
-1
index.tsx
web/src/components/MemoEditor/index.tsx
+21
-7
MonthNavigator.tsx
web/src/components/StatisticsView/MonthNavigator.tsx
+1
-1
StatisticsView.tsx
web/src/components/StatisticsView/StatisticsView.tsx
+1
-1
No files found.
web/src/components/DateTimeInput.tsx
View file @
fd99e109
import
dayjs
from
"dayjs"
;
import
{
isEqual
}
from
"lodash-es"
;
import
toast
from
"react-hot-toast"
;
import
{
cn
}
from
"@/utils"
;
...
...
@@ -5,25 +6,22 @@ import { cn } from "@/utils";
// Helper function to convert Date to local datetime string.
const
toLocalDateTimeString
=
(
date
:
Date
|
undefined
):
string
=>
{
if
(
!
date
)
return
""
;
return
new
Date
(
date
.
getTime
()
-
date
.
getTimezoneOffset
()
*
60000
).
toISOString
().
slice
(
0
,
-
1
);
return
dayjs
(
date
).
format
(
"YYYY-MM-DDTHH:mm:ss"
);
};
interface
Props
{
label
:
string
;
value
:
Date
|
undefined
;
originalValue
:
Date
|
undefined
;
onChange
:
(
date
:
Date
)
=>
void
;
}
const
DateTimeInput
:
React
.
FC
<
Props
>
=
({
label
,
value
,
originalValue
,
onChange
})
=>
{
const
DateTimeInput
:
React
.
FC
<
Props
>
=
({
value
,
originalValue
,
onChange
})
=>
{
return
(
<
div
className=
"w-full flex items-center gap-2"
>
<
span
>
{
label
}
</
span
>
<
input
type=
"text"
className=
{
cn
(
"flex-1
px-1 bg-transparent rounded text-xs transition-all"
,
"border-transparent
focus:border-gray-300 dark:focus:border-zinc-700"
,
"w-auto
px-1 bg-transparent rounded text-xs transition-all"
,
"border-transparent outline-none
focus:border-gray-300 dark:focus:border-zinc-700"
,
!
isEqual
(
value
,
originalValue
)
&&
"border-gray-300 dark:border-zinc-700"
,
"border"
,
)
}
...
...
@@ -42,7 +40,6 @@ const DateTimeInput: React.FC<Props> = ({ label, value, originalValue, onChange
}
}
placeholder=
"YYYY-MM-DDTHH:mm:ss"
/>
</
div
>
);
};
...
...
web/src/components/HomeSidebar/HomeSidebar.tsx
View file @
fd99e109
...
...
@@ -88,9 +88,9 @@ const HomeSidebar = observer((props: Props) => {
</
NavLink
>
))
}
</
div
>
<
MemoFilters
/>
<
div
className=
"px-2 w-full"
>
<
StatisticsView
/>
<
MemoFilters
/>
{
currentUser
&&
<
ShortcutsSection
/>
}
<
TagsSection
/>
</
div
>
...
...
web/src/components/MemoEditor/index.tsx
View file @
fd99e109
import
{
Button
}
from
"@usememos/mui"
;
import
copy
from
"copy-to-clipboard"
;
import
{
isEqual
}
from
"lodash-es"
;
import
{
LoaderIcon
,
SendIcon
}
from
"lucide-react"
;
import
{
observer
}
from
"mobx-react-lite"
;
...
...
@@ -11,6 +12,7 @@ import { TAB_SPACE_WIDTH } from "@/helpers/consts";
import
{
isValidUrl
}
from
"@/helpers/utils"
;
import
useAsyncEffect
from
"@/hooks/useAsyncEffect"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
{
extractMemoIdFromName
}
from
"@/store/common"
;
import
{
memoStore
,
resourceStore
,
userStore
,
workspaceStore
}
from
"@/store/v2"
;
import
{
Location
,
Memo
,
MemoRelation
,
MemoRelation_Type
,
Visibility
}
from
"@/types/proto/api/v1/memo_service"
;
import
{
Resource
}
from
"@/types/proto/api/v1/resource_service"
;
...
...
@@ -547,13 +549,25 @@ const MemoEditor = observer((props: Props) => {
{
/* Show memo metadata if memoName is provided */
}
{
memoName
&&
(
<
div
className=
"w-full mb-4 text-xs leading-5 px-4 opacity-60 font-mono text-gray-500 dark:text-zinc-500"
>
<
div
className=
"grid grid-cols-[auto_1fr] gap-x-4 gap-y-0.5 items-center"
>
{
!
isEqual
(
createTime
,
updateTime
)
&&
(
<
DateTimeInput
label=
"Updated"
value=
{
updateTime
}
originalValue=
{
originalUpdateTime
}
onChange=
{
setUpdateTime
}
/>
<>
<
span
className=
"text-left"
>
Updated
</
span
>
<
DateTimeInput
value=
{
updateTime
}
originalValue=
{
originalUpdateTime
}
onChange=
{
setUpdateTime
}
/>
</>
)
}
<
DateTimeInput
label=
"Created"
value=
{
createTime
}
originalValue=
{
originalCreateTime
}
onChange=
{
setCreateTime
}
/>
<
div
className=
"w-full flex items-center gap-2"
>
<
span
>
ID:
</
span
>
<
span
>
{
memoName
}
</
span
>
<
span
className=
"text-left"
>
Created
</
span
>
<
DateTimeInput
value=
{
createTime
}
originalValue=
{
originalCreateTime
}
onChange=
{
setCreateTime
}
/>
<
span
className=
"text-left"
>
ID
</
span
>
<
span
className=
"px-1 border border-transparent cursor-default"
onClick=
{
()
=>
{
copy
(
extractMemoIdFromName
(
memoName
));
toast
.
success
(
t
(
"message.copied"
));
}
}
>
{
extractMemoIdFromName
(
memoName
)
}
</
span
>
</
div
>
</
div
>
)
}
...
...
web/src/components/StatisticsView/MonthNavigator.tsx
View file @
fd99e109
...
...
@@ -17,7 +17,7 @@ export const MonthNavigator = ({ visibleMonth, onMonthChange }: MonthNavigatorPr
return
(
<
div
className=
"w-full mb-1 flex flex-row justify-between items-center gap-1"
>
<
div
className=
"relative text-sm inline-flex flex-row items-center w-auto gap-2 dark:text-gray-400"
>
<
CalendarIcon
className=
"w-4 h-
4
"
/>
<
CalendarIcon
className=
"w-4 h-
auto opacity-70 ml-px
"
/>
{
currentMonth
.
toLocaleString
(
i18n
.
language
,
{
year
:
"numeric"
,
month
:
"long"
})
}
</
div
>
<
div
className=
"flex justify-end items-center shrink-0 gap-1"
>
...
...
web/src/components/StatisticsView/StatisticsView.tsx
View file @
fd99e109
...
...
@@ -34,7 +34,7 @@ const StatisticsView = observer(() => {
const
hasPinnedMemos
=
currentUser
&&
(
userStore
.
state
.
currentUserStats
?.
pinnedMemos
||
[]).
length
>
0
;
return
(
<
div
className=
"group w-full mt-
3 space-y-1 text-gray-5
00 dark:text-gray-400 animate-fade-in"
>
<
div
className=
"group w-full mt-
2 space-y-1 text-zinc-6
00 dark:text-gray-400 animate-fade-in"
>
<
MonthNavigator
visibleMonth=
{
visibleMonthString
}
onMonthChange=
{
setVisibleMonthString
}
/>
<
div
className=
"w-full animate-scale-in"
>
...
...
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