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
d1007950
Unverified
Commit
d1007950
authored
Dec 03, 2022
by
boojack
Committed by
GitHub
Dec 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove emoji picker (#667)
parent
331226ec
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
106 deletions
+5
-106
package.json
web/package.json
+0
-1
EmojiPicker.tsx
web/src/components/Editor/EmojiPicker.tsx
+0
-52
MemoEditor.tsx
web/src/components/MemoEditor.tsx
+0
-30
tailwind.css
web/src/css/tailwind.css
+2
-2
auth.less
web/src/less/auth.less
+1
-1
memo-editor.less
web/src/less/memo-editor.less
+0
-13
Auth.tsx
web/src/pages/Auth.tsx
+2
-2
yarn.lock
web/yarn.lock
+0
-5
No files found.
web/package.json
View file @
d1007950
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
"axios"
:
"^0.27.2"
,
"axios"
:
"^0.27.2"
,
"copy-to-clipboard"
:
"^3.3.2"
,
"copy-to-clipboard"
:
"^3.3.2"
,
"dayjs"
:
"^1.11.3"
,
"dayjs"
:
"^1.11.3"
,
"emoji-picker-react"
:
"^3.6.2"
,
"highlight.js"
:
"^11.6.0"
,
"highlight.js"
:
"^11.6.0"
,
"i18next"
:
"^21.9.2"
,
"i18next"
:
"^21.9.2"
,
"lodash-es"
:
"^4.17.21"
,
"lodash-es"
:
"^4.17.21"
,
...
...
web/src/components/Editor/EmojiPicker.tsx
deleted
100644 → 0
View file @
331226ec
import
Picker
,
{
IEmojiPickerProps
}
from
"emoji-picker-react"
;
import
{
useEffect
,
useState
}
from
"react"
;
interface
Props
{
shouldShow
:
boolean
;
onEmojiClick
:
IEmojiPickerProps
[
"onEmojiClick"
];
onShouldShowEmojiPickerChange
:
(
status
:
boolean
)
=>
void
;
}
interface
State
{
hasShown
:
boolean
;
}
export
const
EmojiPicker
:
React
.
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
shouldShow
,
onEmojiClick
,
onShouldShowEmojiPickerChange
}
=
props
;
const
[
state
,
setState
]
=
useState
<
State
>
({
hasShown
:
false
,
});
useEffect
(()
=>
{
if
(
shouldShow
)
{
const
handleClickOutside
=
(
event
:
MouseEvent
)
=>
{
event
.
stopPropagation
();
const
emojiWrapper
=
document
.
querySelector
(
".emoji-picker-react"
);
const
isContains
=
emojiWrapper
?.
contains
(
event
.
target
as
Node
);
if
(
!
isContains
)
{
onShouldShowEmojiPickerChange
(
false
);
}
};
window
.
addEventListener
(
"click"
,
handleClickOutside
,
{
capture
:
true
,
once
:
true
,
});
setState
({
hasShown
:
true
,
});
}
},
[
shouldShow
]);
return
(
<>
{
state
.
hasShown
&&
(
<
div
className=
{
`emoji-picker ${shouldShow ? "" : "hidden"}`
}
>
<
Picker
onEmojiClick=
{
onEmojiClick
}
disableSearchBar
/>
</
div
>
)
}
</>
);
};
export
default
EmojiPicker
;
web/src/components/MemoEditor.tsx
View file @
d1007950
import
{
IEmojiData
}
from
"emoji-picker-react"
;
import
{
toLower
}
from
"lodash"
;
import
{
toLower
}
from
"lodash"
;
import
React
,
{
useCallback
,
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
React
,
{
useCallback
,
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useTranslation
}
from
"react-i18next"
;
...
@@ -11,7 +10,6 @@ import Icon from "./Icon";
...
@@ -11,7 +10,6 @@ import Icon from "./Icon";
import
toastHelper
from
"./Toast"
;
import
toastHelper
from
"./Toast"
;
import
Selector
from
"./common/Selector"
;
import
Selector
from
"./common/Selector"
;
import
Editor
,
{
EditorRefActions
}
from
"./Editor/Editor"
;
import
Editor
,
{
EditorRefActions
}
from
"./Editor/Editor"
;
import
EmojiPicker
from
"./Editor/EmojiPicker"
;
import
ResourceIcon
from
"./ResourceIcon"
;
import
ResourceIcon
from
"./ResourceIcon"
;
import
showResourcesSelectorDialog
from
"./ResourcesSelectorDialog"
;
import
showResourcesSelectorDialog
from
"./ResourcesSelectorDialog"
;
import
"../less/memo-editor.less"
;
import
"../less/memo-editor.less"
;
...
@@ -242,10 +240,6 @@ const MemoEditor = () => {
...
@@ -242,10 +240,6 @@ const MemoEditor = () => {
setEditorContentCache
(
content
);
setEditorContentCache
(
content
);
};
};
const
handleEmojiPickerBtnClick
=
()
=>
{
handleChangeShouldShowEmojiPicker
(
!
state
.
shouldShowEmojiPicker
);
};
const
handleCheckBoxBtnClick
=
()
=>
{
const
handleCheckBoxBtnClick
=
()
=>
{
if
(
!
editorRef
.
current
)
{
if
(
!
editorRef
.
current
)
{
return
;
return
;
...
@@ -320,22 +314,6 @@ const MemoEditor = () => {
...
@@ -320,22 +314,6 @@ const MemoEditor = () => {
}
}
},
[]);
},
[]);
const
handleChangeShouldShowEmojiPicker
=
(
status
:
boolean
)
=>
{
setState
({
...
state
,
shouldShowEmojiPicker
:
status
,
});
};
const
handleEmojiClick
=
(
_
:
any
,
emojiObject
:
IEmojiData
)
=>
{
if
(
!
editorRef
.
current
)
{
return
;
}
editorRef
.
current
.
insertText
(
`
${
emojiObject
.
emoji
}
`
);
handleChangeShouldShowEmojiPicker
(
false
);
};
const
handleDeleteResource
=
async
(
resourceId
:
ResourceId
)
=>
{
const
handleDeleteResource
=
async
(
resourceId
:
ResourceId
)
=>
{
editorStateService
.
setResourceList
(
editorState
.
resourceList
.
filter
((
resource
)
=>
resource
.
id
!==
resourceId
));
editorStateService
.
setResourceList
(
editorState
.
resourceList
.
filter
((
resource
)
=>
resource
.
id
!==
resourceId
));
if
(
editorState
.
editMemoId
)
{
if
(
editorState
.
editMemoId
)
{
...
@@ -401,9 +379,6 @@ const MemoEditor = () => {
...
@@ -401,9 +379,6 @@ const MemoEditor = () => {
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
<
button
className=
"action-btn !hidden sm:!flex "
>
<
Icon
.
Smile
className=
"icon-img"
onClick=
{
handleEmojiPickerBtnClick
}
/>
</
button
>
<
button
className=
"action-btn"
>
<
button
className=
"action-btn"
>
<
Icon
.
CheckSquare
className=
"icon-img"
onClick=
{
handleCheckBoxBtnClick
}
/>
<
Icon
.
CheckSquare
className=
"icon-img"
onClick=
{
handleCheckBoxBtnClick
}
/>
</
button
>
</
button
>
...
@@ -427,11 +402,6 @@ const MemoEditor = () => {
...
@@ -427,11 +402,6 @@ const MemoEditor = () => {
<
button
className=
"action-btn"
onClick=
{
handleFullscreenBtnClick
}
>
<
button
className=
"action-btn"
onClick=
{
handleFullscreenBtnClick
}
>
{
state
.
fullscreen
?
<
Icon
.
Minimize
className=
"icon-img"
/>
:
<
Icon
.
Maximize
className=
"icon-img"
/>
}
{
state
.
fullscreen
?
<
Icon
.
Minimize
className=
"icon-img"
/>
:
<
Icon
.
Maximize
className=
"icon-img"
/>
}
</
button
>
</
button
>
<
EmojiPicker
shouldShow=
{
state
.
shouldShowEmojiPicker
}
onEmojiClick=
{
handleEmojiClick
}
onShouldShowEmojiPickerChange=
{
handleChangeShouldShowEmojiPicker
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
{
editorState
.
resourceList
&&
editorState
.
resourceList
.
length
>
0
&&
(
{
editorState
.
resourceList
&&
editorState
.
resourceList
.
length
>
0
&&
(
...
...
web/src/css/tailwind.css
View file @
d1007950
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
}
}
.btn-primary
{
.btn-primary
{
@apply
btn-normal
border-transparent
bg-green-600
text-white
dark
:
text-gray-200
;
@apply
btn-normal
border-transparent
bg-green-600
text-white
dark
:
border-transparent
dark
:
text-gray-200
;
}
}
.btn-danger
{
.btn-danger
{
...
@@ -32,6 +32,6 @@
...
@@ -32,6 +32,6 @@
}
}
.input-text
{
.input-text
{
@apply
w-full
px-3
py-2
leading-6
text-sm
rounded
border
dark
:
border-zinc-700
dark
:
bg-zinc-800
;
@apply
w-full
px-3
py-2
leading-6
text-sm
dark
:
text-gray-200
rounded
border
focus
:
outline
focus
:
outline-2
dark
:
border-zinc-700
dark
:
bg-zinc-800
;
}
}
}
}
web/src/less/auth.less
View file @
d1007950
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
@apply py-2;
@apply py-2;
> input {
> input {
@apply w-full py-3 px-3 text-base
shadow-inner rounded-lg border border-solid border-gray-400 hover:opacity-80 dark:bg-zinc-800 dark:text-gray-200 dark:border-gray-600
;
@apply w-full py-3 px-3 text-base
rounded-lg
;
}
}
}
}
}
}
...
...
web/src/less/memo-editor.less
View file @
d1007950
...
@@ -17,11 +17,6 @@
...
@@ -17,11 +17,6 @@
top: unset !important;
top: unset !important;
}
}
.emoji-picker-react {
@apply !bottom-8;
top: unset !important;
}
.items-wrapper {
.items-wrapper {
@apply mb-1 bottom-full top-auto;
@apply mb-1 bottom-full top-auto;
}
}
...
@@ -96,14 +91,6 @@
...
@@ -96,14 +91,6 @@
@apply hidden ml-1 text-xs leading-5 text-gray-700 border border-gray-300 rounded-xl px-2;
@apply hidden ml-1 text-xs leading-5 text-gray-700 border border-gray-300 rounded-xl px-2;
}
}
}
}
.emoji-picker-react {
@apply absolute shadow left-6 top-8;
li.emoji::before {
@apply hidden;
}
}
}
}
}
}
...
...
web/src/pages/Auth.tsx
View file @
d1007950
...
@@ -126,11 +126,11 @@ const Auth = () => {
...
@@ -126,11 +126,11 @@ const Auth = () => {
<
div
className=
{
`page-content-container ${actionBtnLoadingState.isLoading ? "requesting" : ""}`
}
>
<
div
className=
{
`page-content-container ${actionBtnLoadingState.isLoading ? "requesting" : ""}`
}
>
<
div
className=
"form-item-container input-form-container"
>
<
div
className=
"form-item-container input-form-container"
>
<
span
className=
{
`normal-text ${username ? "not-null" : ""}`
}
>
{
t
(
"common.username"
)
}
</
span
>
<
span
className=
{
`normal-text ${username ? "not-null" : ""}`
}
>
{
t
(
"common.username"
)
}
</
span
>
<
input
type=
"text"
value=
{
username
}
onChange=
{
handleUsernameInputChanged
}
required
/>
<
input
className=
"input-text"
type=
"text"
value=
{
username
}
onChange=
{
handleUsernameInputChanged
}
required
/>
</
div
>
</
div
>
<
div
className=
"form-item-container input-form-container"
>
<
div
className=
"form-item-container input-form-container"
>
<
span
className=
{
`normal-text ${password ? "not-null" : ""}`
}
>
{
t
(
"common.password"
)
}
</
span
>
<
span
className=
{
`normal-text ${password ? "not-null" : ""}`
}
>
{
t
(
"common.password"
)
}
</
span
>
<
input
type=
"password"
value=
{
password
}
onChange=
{
handlePasswordInputChanged
}
required
/>
<
input
className=
"input-text"
type=
"password"
value=
{
password
}
onChange=
{
handlePasswordInputChanged
}
required
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"action-btns-container"
>
<
div
className=
"action-btns-container"
>
...
...
web/yarn.lock
View file @
d1007950
...
@@ -1736,11 +1736,6 @@ emittery@^0.10.2:
...
@@ -1736,11 +1736,6 @@ emittery@^0.10.2:
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933"
integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==
integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==
emoji-picker-react@^3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/emoji-picker-react/-/emoji-picker-react-3.6.2.tgz#e414971bf9421b0825484f3b82623fef995c3c4b"
integrity sha512-PK3dfljGxeyN8fDz2FAsDYKPYGgo6/tkRyzJjLVaw0fksJg7jA3OJPIlHq2IIzTmlC/NKhcI/oaf0uEo5azYGA==
emoji-regex@^8.0.0:
emoji-regex@^8.0.0:
version "8.0.0"
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
...
...
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