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
db8b8f0d
Unverified
Commit
db8b8f0d
authored
Jul 01, 2023
by
boojack
Committed by
GitHub
Jul 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove unused kit components (#1871)
parent
30fae208
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
55 deletions
+10
-55
ArchivedMemo.tsx
web/src/components/ArchivedMemo.tsx
+3
-3
Memo.tsx
web/src/components/Memo.tsx
+3
-4
MyAccountSection.tsx
web/src/components/Settings/MyAccountSection.tsx
+1
-1
UpgradeVersionBanner.tsx
web/src/components/UpgradeVersionBanner.tsx
+3
-6
Divider.tsx
web/src/components/kit/Divider.tsx
+0
-9
Tooltip.tsx
web/src/components/kit/Tooltip.tsx
+0
-32
No files found.
web/src/components/ArchivedMemo.tsx
View file @
db8b8f0d
import
{
Tooltip
}
from
"@mui/joy"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useMemoStore
}
from
"@/store/module"
;
import
{
useMemoStore
}
from
"@/store/module"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
{
getDateTimeString
}
from
"@/helpers/datetime"
;
import
useToggle
from
"@/hooks/useToggle"
;
import
useToggle
from
"@/hooks/useToggle"
;
import
Tooltip
from
"./kit/Tooltip"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
MemoContent
from
"./MemoContent"
;
import
MemoContent
from
"./MemoContent"
;
import
MemoResourceListView
from
"./MemoResourceListView"
;
import
MemoResourceListView
from
"./MemoResourceListView"
;
...
@@ -59,12 +59,12 @@ const ArchivedMemo: React.FC<Props> = (props: Props) => {
...
@@ -59,12 +59,12 @@ const ArchivedMemo: React.FC<Props> = (props: Props) => {
<
span
className=
"time-text"
>
{
getDateTimeString
(
memo
.
updatedTs
)
}
</
span
>
<
span
className=
"time-text"
>
{
getDateTimeString
(
memo
.
updatedTs
)
}
</
span
>
</
div
>
</
div
>
<
div
className=
"flex flex-row justify-end items-center gap-x-2"
>
<
div
className=
"flex flex-row justify-end items-center gap-x-2"
>
<
Tooltip
title=
{
t
(
"common.restore"
)
}
side
=
"top"
>
<
Tooltip
title=
{
t
(
"common.restore"
)
}
placement
=
"top"
>
<
button
onClick=
{
handleRestoreMemoClick
}
>
<
button
onClick=
{
handleRestoreMemoClick
}
>
<
Icon
.
ArchiveRestore
className=
"w-4 h-auto cursor-pointer text-gray-500 dark:text-gray-400"
/>
<
Icon
.
ArchiveRestore
className=
"w-4 h-auto cursor-pointer text-gray-500 dark:text-gray-400"
/>
</
button
>
</
button
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
{
t
(
"common.delete"
)
}
side
=
"top"
>
<
Tooltip
title=
{
t
(
"common.delete"
)
}
placement
=
"top"
>
<
button
<
button
onClick=
{
handleDeleteMemoClick
}
onClick=
{
handleDeleteMemoClick
}
className=
{
`text-gray-500 dark:text-gray-400 ${showConfirmDeleteBtn ? "text-red-600" : ""}`
}
className=
{
`text-gray-500 dark:text-gray-400 ${showConfirmDeleteBtn ? "text-red-600" : ""}`
}
...
...
web/src/components/Memo.tsx
View file @
db8b8f0d
import
{
Divider
,
Tooltip
}
from
"@mui/joy"
;
import
{
isEqual
,
uniqWith
}
from
"lodash-es"
;
import
{
isEqual
,
uniqWith
}
from
"lodash-es"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"react"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"react"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
...
@@ -7,8 +8,6 @@ import { useFilterStore, useMemoStore, useUserStore } from "@/store/module";
...
@@ -7,8 +8,6 @@ import { useFilterStore, useMemoStore, useUserStore } from "@/store/module";
import
{
UNKNOWN_ID
}
from
"@/helpers/consts"
;
import
{
UNKNOWN_ID
}
from
"@/helpers/consts"
;
import
{
getRelativeTimeString
}
from
"@/helpers/datetime"
;
import
{
getRelativeTimeString
}
from
"@/helpers/datetime"
;
import
{
useMemoCacheStore
}
from
"@/store/zustand"
;
import
{
useMemoCacheStore
}
from
"@/store/zustand"
;
import
Tooltip
from
"./kit/Tooltip"
;
import
Divider
from
"./kit/Divider"
;
import
{
showCommonDialog
}
from
"./Dialog/CommonDialog"
;
import
{
showCommonDialog
}
from
"./Dialog/CommonDialog"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
MemoContent
from
"./MemoContent"
;
import
MemoContent
from
"./MemoContent"
;
...
@@ -226,7 +225,7 @@ const Memo: React.FC<Props> = (props: Props) => {
...
@@ -226,7 +225,7 @@ const Memo: React.FC<Props> = (props: Props) => {
{
!
isVisitorMode
&&
(
{
!
isVisitorMode
&&
(
<
div
className=
"btns-container space-x-2"
>
<
div
className=
"btns-container space-x-2"
>
{
memo
.
visibility
!==
"PRIVATE"
&&
(
{
memo
.
visibility
!==
"PRIVATE"
&&
(
<
Tooltip
title=
{
t
(
`memo.visibility.${memo.visibility.toLowerCase()}`
)
}
side
=
"top"
>
<
Tooltip
title=
{
t
(
`memo.visibility.${memo.visibility.toLowerCase()}`
)
}
placement
=
"top"
>
<
div
onClick=
{
()
=>
handleMemoVisibilityClick
(
memo
.
visibility
)
}
>
<
div
onClick=
{
()
=>
handleMemoVisibilityClick
(
memo
.
visibility
)
}
>
{
memo
.
visibility
===
"PUBLIC"
?
(
{
memo
.
visibility
===
"PUBLIC"
?
(
<
Icon
.
Globe2
className=
"w-4 h-auto cursor-pointer rounded text-green-600"
/>
<
Icon
.
Globe2
className=
"w-4 h-auto cursor-pointer rounded text-green-600"
/>
...
@@ -258,7 +257,7 @@ const Memo: React.FC<Props> = (props: Props) => {
...
@@ -258,7 +257,7 @@ const Memo: React.FC<Props> = (props: Props) => {
<
Icon
.
Link
className=
"w-4 h-auto mr-2"
/>
<
Icon
.
Link
className=
"w-4 h-auto mr-2"
/>
Mark
Mark
</
span
>
</
span
>
<
Divider
/>
<
Divider
className=
"!my-1"
/>
<
span
className=
"btn text-orange-500"
onClick=
{
handleArchiveMemoClick
}
>
<
span
className=
"btn text-orange-500"
onClick=
{
handleArchiveMemoClick
}
>
<
Icon
.
Archive
className=
"w-4 h-auto mr-2"
/>
<
Icon
.
Archive
className=
"w-4 h-auto mr-2"
/>
{
t
(
"common.archive"
)
}
{
t
(
"common.archive"
)
}
...
...
web/src/components/Settings/MyAccountSection.tsx
View file @
db8b8f0d
...
@@ -37,7 +37,7 @@ const MyAccountSection = () => {
...
@@ -37,7 +37,7 @@ const MyAccountSection = () => {
<
span
className=
"text-2xl leading-10 font-medium"
>
{
user
.
nickname
}
</
span
>
<
span
className=
"text-2xl leading-10 font-medium"
>
{
user
.
nickname
}
</
span
>
<
span
className=
"text-base ml-1 text-gray-500 leading-10 dark:text-gray-400"
>
(
{
user
.
username
}
)
</
span
>
<
span
className=
"text-base ml-1 text-gray-500 leading-10 dark:text-gray-400"
>
(
{
user
.
username
}
)
</
span
>
</
div
>
</
div
>
<
div
className=
"flex flex-row justify-start items-center text-base text-gray-600"
>
{
user
.
email
}
</
div
>
<
div
className=
"flex flex-row justify-start items-center text-base text-gray-600
dark:text-gray-400
"
>
{
user
.
email
}
</
div
>
<
div
className=
"w-full flex flex-row justify-start items-center mt-2 space-x-2"
>
<
div
className=
"w-full flex flex-row justify-start items-center mt-2 space-x-2"
>
<
Button
variant=
"outlined"
onClick=
{
showUpdateAccountDialog
}
>
<
Button
variant=
"outlined"
onClick=
{
showUpdateAccountDialog
}
>
{
t
(
"common.edit"
)
}
{
t
(
"common.edit"
)
}
...
...
web/src/components/UpgradeVersionBanner.tsx
View file @
db8b8f0d
...
@@ -4,7 +4,6 @@ import * as api from "@/helpers/api";
...
@@ -4,7 +4,6 @@ import * as api from "@/helpers/api";
import
storage
from
"@/helpers/storage"
;
import
storage
from
"@/helpers/storage"
;
import
{
useGlobalStore
}
from
"@/store/module"
;
import
{
useGlobalStore
}
from
"@/store/module"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
Tooltip
from
"./kit/Tooltip"
;
interface
State
{
interface
State
{
latestVersion
:
string
;
latestVersion
:
string
;
...
@@ -51,11 +50,9 @@ const UpgradeVersionView: React.FC = () => {
...
@@ -51,11 +50,9 @@ const UpgradeVersionView: React.FC = () => {
>
>
✨ New version: v
{
state
.
latestVersion
}
✨ New version: v
{
state
.
latestVersion
}
</
a
>
</
a
>
<
Tooltip
title=
"Ignore upgrade"
side=
"top"
>
<
button
className=
"ml-1 opacity-60 text-gray-600 hover:opacity-100"
onClick=
{
onSkip
}
>
<
button
className=
"ml-1 opacity-60 text-gray-600 hover:opacity-100"
onClick=
{
onSkip
}
>
<
Icon
.
X
className=
"w-4 h-auto"
/>
<
Icon
.
X
className=
"w-4 h-auto"
/>
</
button
>
</
button
>
</
Tooltip
>
</
div
>
</
div
>
);
);
};
};
...
...
web/src/components/kit/Divider.tsx
deleted
100644 → 0
View file @
30fae208
interface
Props
{
className
?:
string
;
}
const
Divider
=
({
className
}:
Props
)
=>
{
return
<
hr
className=
{
`${className} block my-1 border-gray-200 dark:border-gray-600`
}
/>;
};
export
default
Divider
;
web/src/components/kit/Tooltip.tsx
deleted
100644 → 0
View file @
30fae208
import
*
as
TooltipUI
from
"@radix-ui/react-tooltip"
;
type
Side
=
"top"
|
"right"
|
"bottom"
|
"left"
;
interface
Props
{
title
:
string
;
side
:
Side
;
children
:
React
.
ReactNode
;
}
const
Tooltip
=
(
props
:
Props
)
=>
{
const
{
title
,
side
,
children
}
=
props
;
return
(
<
TooltipUI
.
Provider
delayDuration=
{
0
}
skipDelayDuration=
{
0
}
>
<
TooltipUI
.
Root
>
<
TooltipUI
.
Trigger
asChild
>
{
children
}
</
TooltipUI
.
Trigger
>
<
TooltipUI
.
Portal
>
<
TooltipUI
.
Content
className=
"bg-zinc-800 text-gray-300 dark:bg-black shadow text-sm p-1 rounded-md z-[99999]"
side=
{
side
}
sideOffset=
{
6
}
>
{
title
}
</
TooltipUI
.
Content
>
</
TooltipUI
.
Portal
>
</
TooltipUI
.
Root
>
</
TooltipUI
.
Provider
>
);
};
export
default
Tooltip
;
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