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
16dad8b0
Commit
16dad8b0
authored
Oct 05, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update logo
parent
7dc4bc57
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
30 additions
and
44 deletions
+30
-44
README.md
README.md
+1
-1
index.html
web/index.html
+1
-1
logo.png
web/public/logo.png
+0
-0
manifest.json
web/public/manifest.json
+2
-3
App.tsx
web/src/App.tsx
+1
-1
AboutSiteDialog.tsx
web/src/components/AboutSiteDialog.tsx
+4
-4
UpdateCustomizedProfileDialog.tsx
web/src/components/UpdateCustomizedProfileDialog.tsx
+1
-1
UserAvatar.tsx
web/src/components/UserAvatar.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+16
-15
global.ts
web/src/store/module/global.ts
+2
-2
global.ts
web/src/store/reducer/global.ts
+1
-1
resource.d.ts
web/src/types/modules/resource.d.ts
+0
-11
tag.d.ts
web/src/types/modules/tag.d.ts
+0
-3
No files found.
README.md
View file @
16dad8b0
# memos
# memos
<img
height=
"72px"
src=
"https://usememos.com/logo.
webp
"
alt=
"✍️ memos"
align=
"right"
/>
<img
height=
"72px"
src=
"https://usememos.com/logo.
png
"
alt=
"✍️ memos"
align=
"right"
/>
A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.
A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.
...
...
web/index.html
View file @
16dad8b0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"UTF-8"
/>
<meta
charset=
"UTF-8"
/>
<link
rel=
"icon"
href=
"/logo.
webp
"
type=
"image/*"
/>
<link
rel=
"icon"
href=
"/logo.
png
"
type=
"image/*"
/>
<meta
name=
"theme-color"
media=
"(prefers-color-scheme: light)"
content=
"#f4f4f5"
/>
<meta
name=
"theme-color"
media=
"(prefers-color-scheme: light)"
content=
"#f4f4f5"
/>
<meta
name=
"theme-color"
media=
"(prefers-color-scheme: dark)"
content=
"#27272a"
/>
<meta
name=
"theme-color"
media=
"(prefers-color-scheme: dark)"
content=
"#27272a"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
/>
...
...
web/public/logo.png
0 → 100644
View file @
16dad8b0
845 KB
web/public/manifest.json
View file @
16dad8b0
...
@@ -4,9 +4,8 @@
...
@@ -4,9 +4,8 @@
"description"
:
"usememos/memos"
,
"description"
:
"usememos/memos"
,
"icons"
:
[
"icons"
:
[
{
{
"src"
:
"/logo.webp"
,
"src"
:
"/logo.png"
,
"type"
:
"image/webp"
,
"type"
:
"image/png"
"sizes"
:
"520x520"
}
}
],
],
"start_url"
:
"/"
,
"start_url"
:
"/"
,
...
...
web/src/App.tsx
View file @
16dad8b0
...
@@ -70,7 +70,7 @@ const App = () => {
...
@@ -70,7 +70,7 @@ const App = () => {
// dynamic update metadata with customized profile.
// 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.
webp
"
;
link
.
href
=
systemStatus
.
customizedProfile
.
logoUrl
||
"/logo.
png
"
;
},
[
systemStatus
.
customizedProfile
]);
},
[
systemStatus
.
customizedProfile
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
web/src/components/AboutSiteDialog.tsx
View file @
16dad8b0
...
@@ -33,17 +33,17 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
...
@@ -33,17 +33,17 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
<
div
className=
"flex flex-row justify-start items-center mr-2"
>
<
div
className=
"flex flex-row justify-start items-center mr-2"
>
{
t
(
"about.powered-by"
)
}
{
t
(
"about.powered-by"
)
}
<
a
href=
"https://usememos.com"
target=
"_blank"
className=
"flex flex-row justify-start items-center mx-1 hover:underline"
>
<
a
href=
"https://usememos.com"
target=
"_blank"
className=
"flex flex-row justify-start items-center mx-1 hover:underline"
>
<
img
className=
"w-6 h-auto rounded-full mr-1"
src=
"/logo.
webp
"
alt=
""
/>
<
img
className=
"w-6 h-auto rounded-full mr-1"
src=
"/logo.
png
"
alt=
""
/>
memos
memos
</
a
>
</
a
>
<
span
>
v
{
profile
.
version
}
</
span
>
<
span
>
v
{
profile
.
version
}
</
span
>
</
div
>
</
div
>
<
GitHubBadge
/>
<
GitHubBadge
/>
</
div
>
</
div
>
<
div
className=
"border-t w-full mt-3 pt-2 text-sm flex flex-row justify-start items-center space-x-
4
"
>
<
div
className=
"border-t w-full mt-3 pt-2 text-sm flex flex-row justify-start items-center space-x-
2
"
>
<
span
className=
"text-gray-500"
>
{
t
(
"about.other-projects"
)
}
:
</
span
>
<
span
className=
"text-gray-500"
>
{
t
(
"about.other-projects"
)
}
:
</
span
>
<
a
href=
"https://github.com/boojack/slash"
target=
"_blank"
className=
"flex items-center underline text-blue-600 hover:opacity-80"
>
<
a
href=
"https://github.com/boojack/slash"
target=
"_blank"
className=
"flex items-center underline text-blue-600 hover:opacity-80"
>
<
img
className=
"w-
4 h-auto mr-1
"
src=
"https://github.com/boojack/slash/raw/main/resources/logo.png"
alt=
""
/>
<
img
className=
"w-
5 h-auto mr-1 rounded-full
"
src=
"https://github.com/boojack/slash/raw/main/resources/logo.png"
alt=
""
/>
<
span
>
Slash
</
span
>
<
span
>
Slash
</
span
>
</
a
>
</
a
>
<
a
<
a
...
@@ -52,7 +52,7 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
...
@@ -52,7 +52,7 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
className=
"flex items-center underline text-blue-600 hover:opacity-80"
className=
"flex items-center underline text-blue-600 hover:opacity-80"
>
>
<
img
<
img
className=
"w-
4
h-auto mr-1"
className=
"w-
5
h-auto mr-1"
src=
"https://raw.githubusercontent.com/boojack/sticky-notes/main/public/sticky-notes.ico"
src=
"https://raw.githubusercontent.com/boojack/sticky-notes/main/public/sticky-notes.ico"
alt=
""
alt=
""
/>
/>
...
...
web/src/components/UpdateCustomizedProfileDialog.tsx
View file @
16dad8b0
...
@@ -63,7 +63,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
...
@@ -63,7 +63,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
const
handleRestoreButtonClick
=
()
=>
{
const
handleRestoreButtonClick
=
()
=>
{
setPartialState
({
setPartialState
({
name
:
"memos"
,
name
:
"memos"
,
logoUrl
:
"/logo.
webp
"
,
logoUrl
:
"/logo.
png
"
,
description
:
""
,
description
:
""
,
locale
:
"en"
,
locale
:
"en"
,
appearance
:
"system"
,
appearance
:
"system"
,
...
...
web/src/components/UserAvatar.tsx
View file @
16dad8b0
...
@@ -11,7 +11,7 @@ const UserAvatar = (props: Props) => {
...
@@ -11,7 +11,7 @@ const UserAvatar = (props: Props) => {
<
div
className=
{
classNames
(
`w-8 h-8 overflow-clip rounded-full`
,
className
)
}
>
<
div
className=
{
classNames
(
`w-8 h-8 overflow-clip rounded-full`
,
className
)
}
>
<
img
<
img
className=
"w-full h-auto rounded-full shadow min-w-full min-h-full object-cover dark:opacity-80"
className=
"w-full h-auto rounded-full shadow min-w-full min-h-full object-cover dark:opacity-80"
src=
{
avatarUrl
||
"/logo.
webp
"
}
src=
{
avatarUrl
||
"/logo.
png
"
}
alt=
""
alt=
""
/>
/>
</
div
>
</
div
>
...
...
web/src/pages/MemoDetail.tsx
View file @
16dad8b0
...
@@ -14,7 +14,6 @@ import MemoResourceListView from "@/components/MemoResourceListView";
...
@@ -14,7 +14,6 @@ import MemoResourceListView from "@/components/MemoResourceListView";
import
showShareMemoDialog
from
"@/components/ShareMemoDialog"
;
import
showShareMemoDialog
from
"@/components/ShareMemoDialog"
;
import
UserAvatar
from
"@/components/UserAvatar"
;
import
UserAvatar
from
"@/components/UserAvatar"
;
import
VisibilityIcon
from
"@/components/VisibilityIcon"
;
import
VisibilityIcon
from
"@/components/VisibilityIcon"
;
import
{
memoServiceClient
}
from
"@/grpcweb"
;
import
{
UNKNOWN_ID
,
VISIBILITY_SELECTOR_ITEMS
}
from
"@/helpers/consts"
;
import
{
UNKNOWN_ID
,
VISIBILITY_SELECTOR_ITEMS
}
from
"@/helpers/consts"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
import
useCurrentUser
from
"@/hooks/useCurrentUser"
;
...
@@ -25,15 +24,14 @@ import { User } from "@/types/proto/api/v2/user_service";
...
@@ -25,15 +24,14 @@ import { User } from "@/types/proto/api/v2/user_service";
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
const
MemoDetail
=
()
=>
{
const
MemoDetail
=
()
=>
{
const
t
=
useTranslate
();
const
params
=
useParams
();
const
params
=
useParams
();
const
navigateTo
=
useNavigateTo
();
const
navigateTo
=
useNavigateTo
();
const
t
=
useTranslate
();
const
globalStore
=
useGlobalStore
();
const
globalStore
=
useGlobalStore
();
const
memoStore
=
useMemoStore
();
const
memoStore
=
useMemoStore
();
const
userV1Store
=
useUserV1Store
();
const
userV1Store
=
useUserV1Store
();
const
currentUser
=
useCurrentUser
();
const
currentUser
=
useCurrentUser
();
const
[
user
,
setUser
]
=
useState
<
User
>
();
const
[
creator
,
setCreator
]
=
useState
<
User
>
();
const
[
comments
,
setComments
]
=
useState
<
Memo
[]
>
([]);
const
{
systemStatus
}
=
globalStore
.
state
;
const
{
systemStatus
}
=
globalStore
.
state
;
const
memoId
=
Number
(
params
.
memoId
);
const
memoId
=
Number
(
params
.
memoId
);
const
memo
=
memoStore
.
state
.
memos
.
find
((
memo
)
=>
memo
.
id
===
memoId
);
const
memo
=
memoStore
.
state
.
memos
.
find
((
memo
)
=>
memo
.
id
===
memoId
);
...
@@ -42,6 +40,10 @@ const MemoDetail = () => {
...
@@ -42,6 +40,10 @@ const MemoDetail = () => {
memo
?.
relationList
.
filter
(
memo
?.
relationList
.
filter
(
(
relation
)
=>
relation
.
memoId
===
memo
?.
id
&&
relation
.
relatedMemoId
!==
memo
?.
id
&&
relation
.
type
===
"REFERENCE"
(
relation
)
=>
relation
.
memoId
===
memo
?.
id
&&
relation
.
relatedMemoId
!==
memo
?.
id
&&
relation
.
type
===
"REFERENCE"
)
||
[];
)
||
[];
const
commentRelations
=
memo
?.
relationList
.
filter
((
relation
)
=>
relation
.
relatedMemoId
===
memo
.
id
&&
relation
.
type
===
"COMMENT"
)
||
[];
const
comments
=
commentRelations
.
map
((
relation
)
=>
memoStore
.
state
.
memos
.
find
((
memo
)
=>
memo
.
id
===
relation
.
memoId
))
.
filter
((
memo
)
=>
memo
)
as
Memo
[];
// Prepare memo.
// Prepare memo.
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -50,7 +52,7 @@ const MemoDetail = () => {
...
@@ -50,7 +52,7 @@ const MemoDetail = () => {
.
fetchMemoById
(
memoId
)
.
fetchMemoById
(
memoId
)
.
then
(
async
(
memo
)
=>
{
.
then
(
async
(
memo
)
=>
{
const
user
=
await
userV1Store
.
getOrFetchUserByUsername
(
memo
.
creatorUsername
);
const
user
=
await
userV1Store
.
getOrFetchUserByUsername
(
memo
.
creatorUsername
);
set
Use
r
(
user
);
set
Creato
r
(
user
);
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
error
(
error
);
console
.
error
(
error
);
...
@@ -67,20 +69,19 @@ const MemoDetail = () => {
...
@@ -67,20 +69,19 @@ const MemoDetail = () => {
return
;
return
;
}
}
fetchMemoComments
();
(
async
()
=>
{
},
[
memo
]);
await
fetchMemoComments
();
})();
},
[
memo
?.
relationList
]);
const
fetchMemoComments
=
async
()
=>
{
const
fetchMemoComments
=
async
()
=>
{
if
(
!
memo
)
{
if
(
!
memo
)
{
return
;
return
;
}
}
const
{
memos
}
=
await
memoServiceClient
.
listMemoComments
({
const
commentRelations
=
memo
.
relationList
.
filter
((
relation
)
=>
relation
.
relatedMemoId
===
memo
.
id
&&
relation
.
type
===
"COMMENT"
);
id
:
memo
.
id
,
const
requests
=
commentRelations
.
map
((
relation
)
=>
memoStore
.
fetchMemoById
(
relation
.
memoId
));
});
await
Promise
.
all
(
requests
);
const
requests
=
memos
.
map
((
memo
)
=>
memoStore
.
fetchMemoById
(
memo
.
id
));
const
composedMemos
=
await
Promise
.
all
(
requests
);
setComments
(
composedMemos
);
};
};
if
(
!
memo
)
{
if
(
!
memo
)
{
...
@@ -135,8 +136,8 @@ const MemoDetail = () => {
...
@@ -135,8 +136,8 @@ const MemoDetail = () => {
</
Tooltip
>
</
Tooltip
>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
<
Icon
.
Dot
className=
"w-4 h-auto text-gray-400 dark:text-zinc-400"
/>
<
Link
className=
"flex flex-row justify-start items-center"
to=
{
`/u/${encodeURIComponent(memo.creatorUsername)}`
}
>
<
Link
className=
"flex flex-row justify-start items-center"
to=
{
`/u/${encodeURIComponent(memo.creatorUsername)}`
}
>
<
UserAvatar
className=
"!w-5 !h-auto mr-1"
avatarUrl=
{
use
r
?.
avatarUrl
}
/>
<
UserAvatar
className=
"!w-5 !h-auto mr-1"
avatarUrl=
{
creato
r
?.
avatarUrl
}
/>
<
span
className=
"text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400"
>
{
use
r
?.
nickname
}
</
span
>
<
span
className=
"text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400"
>
{
creato
r
?.
nickname
}
</
span
>
</
Link
>
</
Link
>
{
allowEdit
&&
(
{
allowEdit
&&
(
<>
<>
...
...
web/src/store/module/global.ts
View file @
16dad8b0
...
@@ -21,7 +21,7 @@ export const initialGlobalState = async () => {
...
@@ -21,7 +21,7 @@ export const initialGlobalState = async () => {
memoDisplayWithUpdatedTs
:
false
,
memoDisplayWithUpdatedTs
:
false
,
customizedProfile
:
{
customizedProfile
:
{
name
:
"memos"
,
name
:
"memos"
,
logoUrl
:
"/logo.
webp
"
,
logoUrl
:
"/logo.
png
"
,
description
:
""
,
description
:
""
,
locale
:
"en"
,
locale
:
"en"
,
appearance
:
"system"
,
appearance
:
"system"
,
...
@@ -45,7 +45,7 @@ export const initialGlobalState = async () => {
...
@@ -45,7 +45,7 @@ export const initialGlobalState = async () => {
...
data
,
...
data
,
customizedProfile
:
{
customizedProfile
:
{
name
:
customizedProfile
.
name
||
"memos"
,
name
:
customizedProfile
.
name
||
"memos"
,
logoUrl
:
customizedProfile
.
logoUrl
||
"/logo.
webp
"
,
logoUrl
:
customizedProfile
.
logoUrl
||
"/logo.
png
"
,
description
:
customizedProfile
.
description
,
description
:
customizedProfile
.
description
,
locale
:
customizedProfile
.
locale
||
"en"
,
locale
:
customizedProfile
.
locale
||
"en"
,
appearance
:
customizedProfile
.
appearance
||
"system"
,
appearance
:
customizedProfile
.
appearance
||
"system"
,
...
...
web/src/store/reducer/global.ts
View file @
16dad8b0
...
@@ -26,7 +26,7 @@ const globalSlice = createSlice({
...
@@ -26,7 +26,7 @@ const globalSlice = createSlice({
memoDisplayWithUpdatedTs
:
false
,
memoDisplayWithUpdatedTs
:
false
,
customizedProfile
:
{
customizedProfile
:
{
name
:
"memos"
,
name
:
"memos"
,
logoUrl
:
"/logo.
webp
"
,
logoUrl
:
"/logo.
png
"
,
description
:
""
,
description
:
""
,
locale
:
"en"
,
locale
:
"en"
,
appearance
:
"system"
,
appearance
:
"system"
,
...
...
web/src/types/modules/resource.d.ts
View file @
16dad8b0
...
@@ -5,14 +5,3 @@ interface ResourceCreate {
...
@@ -5,14 +5,3 @@ interface ResourceCreate {
externalLink
:
string
;
externalLink
:
string
;
type
:
string
;
type
:
string
;
}
}
interface
ResourcePatch
{
id
:
ResourceId
;
filename
?:
string
;
memoId
?:
number
;
}
interface
ResourceFind
{
offset
?:
number
;
limit
?:
number
;
}
web/src/types/modules/tag.d.ts
deleted
100644 → 0
View file @
7dc4bc57
interface
TagFind
{
creatorUsername
?:
string
;
}
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