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
b0b2776d
Unverified
Commit
b0b2776d
authored
Sep 08, 2022
by
boojack
Committed by
GitHub
Sep 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update button entries (#206)
parent
e9ac6aff
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
66 deletions
+49
-66
MenuBtnsPopup.tsx
web/src/components/MenuBtnsPopup.tsx
+16
-25
Sidebar.tsx
web/src/components/Sidebar.tsx
+8
-15
explore.less
web/src/less/explore.less
+12
-14
en.json
web/src/locales/en.json
+1
-0
zh.json
web/src/locales/zh.json
+1
-0
Explore.tsx
web/src/pages/Explore.tsx
+11
-12
No files found.
web/src/components/MenuBtnsPopup.tsx
View file @
b0b2776d
import
{
useEffect
,
useRef
}
from
"react"
;
import
{
useEffect
,
useRef
}
from
"react"
;
import
*
as
api
from
"../helpers/api"
;
import
{
locationService
,
userService
}
from
"../services"
;
import
{
locationService
,
userService
}
from
"../services"
;
import
useI18n
from
"../hooks/useI18n"
;
import
useI18n
from
"../hooks/useI18n"
;
import
toastHelper
from
"./Toast"
;
import
Only
from
"./common/OnlyWhen"
;
import
Only
from
"./common/OnlyWhen"
;
import
showAboutSiteDialog
from
"./AboutSiteDialog"
;
import
showAboutSiteDialog
from
"./AboutSiteDialog"
;
import
showArchivedMemoDialog
from
"./ArchivedMemoDialog"
;
import
showResourcesDialog
from
"./ResourcesDialog"
;
import
"../less/menu-btns-popup.less"
;
import
"../less/menu-btns-popup.less"
;
interface
Props
{
interface
Props
{
...
@@ -32,27 +32,16 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {
...
@@ -32,27 +32,16 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {
}
}
},
[
shownStatus
]);
},
[
shownStatus
]);
const
handlePingBtnClick
=
()
=>
{
const
handleResourcesBtnClick
=
()
=>
{
api
showResourcesDialog
();
.
getSystemStatus
()
.
then
(({
data
})
=>
{
const
{
data
:
{
profile
},
}
=
data
;
toastHelper
.
info
(
JSON
.
stringify
(
profile
,
null
,
4
));
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
toastHelper
.
error
(
error
.
response
.
data
.
message
);
});
};
};
const
handleA
bout
BtnClick
=
()
=>
{
const
handleA
rchived
BtnClick
=
()
=>
{
showA
boutSite
Dialog
();
showA
rchivedMemo
Dialog
();
};
};
const
handle
Explore
BtnClick
=
()
=>
{
const
handle
About
BtnClick
=
()
=>
{
locationService
.
pushHistory
(
"/explore"
);
showAboutSiteDialog
(
);
};
};
const
handleSignOutBtnClick
=
async
()
=>
{
const
handleSignOutBtnClick
=
async
()
=>
{
...
@@ -69,12 +58,14 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {
...
@@ -69,12 +58,14 @@ const MenuBtnsPopup: React.FC<Props> = (props: Props) => {
return
(
return
(
<
div
className=
{
`menu-btns-popup ${shownStatus ? "" : "hidden"}`
}
ref=
{
popupElRef
}
>
<
div
className=
{
`menu-btns-popup ${shownStatus ? "" : "hidden"}`
}
ref=
{
popupElRef
}
>
<
button
className=
"btn action-btn"
onClick=
{
handleExploreBtnClick
}
>
<
Only
when=
{
!
userService
.
isVisitorMode
()
}
>
<
span
className=
"icon"
>
👾
</
span
>
Explore
<
button
className=
"btn action-btn"
onClick=
{
handleResourcesBtnClick
}
>
</
button
>
<
span
className=
"icon"
>
🌄
</
span
>
{
t
(
"sidebar.resources"
)
}
<
button
className=
"btn action-btn"
onClick=
{
handlePingBtnClick
}
>
</
button
>
<
span
className=
"icon"
>
🎯
</
span
>
Ping
<
button
className=
"btn action-btn"
onClick=
{
handleArchivedBtnClick
}
>
</
button
>
<
span
className=
"icon"
>
🗂
</
span
>
{
t
(
"sidebar.archived"
)
}
</
button
>
</
Only
>
<
button
className=
"btn action-btn"
onClick=
{
handleAboutBtnClick
}
>
<
button
className=
"btn action-btn"
onClick=
{
handleAboutBtnClick
}
>
<
span
className=
"icon"
>
🤠
</
span
>
{
t
(
"common.about"
)
}
<
span
className=
"icon"
>
🤠
</
span
>
{
t
(
"common.about"
)
}
</
button
>
</
button
>
...
...
web/src/components/Sidebar.tsx
View file @
b0b2776d
import
{
userService
}
from
"../services"
;
import
{
locationService
,
userService
}
from
"../services"
;
import
useI18n
from
"../hooks/useI18n"
;
import
useI18n
from
"../hooks/useI18n"
;
import
Icon
from
"./Icon"
;
import
Icon
from
"./Icon"
;
import
Only
from
"./common/OnlyWhen"
;
import
Only
from
"./common/OnlyWhen"
;
import
showDailyReviewDialog
from
"./DailyReviewDialog"
;
import
showDailyReviewDialog
from
"./DailyReviewDialog"
;
import
showSettingDialog
from
"./SettingDialog"
;
import
showSettingDialog
from
"./SettingDialog"
;
import
showArchivedMemoDialog
from
"./ArchivedMemoDialog"
;
import
showResourcesDialog
from
"./ResourcesDialog"
;
import
UserBanner
from
"./UserBanner"
;
import
UserBanner
from
"./UserBanner"
;
import
UsageHeatMap
from
"./UsageHeatMap"
;
import
UsageHeatMap
from
"./UsageHeatMap"
;
import
ShortcutList
from
"./ShortcutList"
;
import
ShortcutList
from
"./ShortcutList"
;
...
@@ -15,14 +13,12 @@ import "../less/siderbar.less";
...
@@ -15,14 +13,12 @@ import "../less/siderbar.less";
const
Sidebar
=
()
=>
{
const
Sidebar
=
()
=>
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
handle
MyAccount
BtnClick
=
()
=>
{
const
handle
Setting
BtnClick
=
()
=>
{
showSettingDialog
();
showSettingDialog
();
};
};
const
handleResourcesBtnClick
=
()
=>
{
showResourcesDialog
();
const
handleExploreBtnClick
=
()
=>
{
};
locationService
.
pushHistory
(
"/explore"
);
const
handleArchivedBtnClick
=
()
=>
{
showArchivedMemoDialog
();
};
};
return
(
return
(
...
@@ -39,14 +35,11 @@ const Sidebar = () => {
...
@@ -39,14 +35,11 @@ const Sidebar = () => {
<
span
className=
"icon"
>
📅
</
span
>
{
t
(
"sidebar.daily-review"
)
}
<
span
className=
"icon"
>
📅
</
span
>
{
t
(
"sidebar.daily-review"
)
}
</
button
>
</
button
>
<
Only
when=
{
!
userService
.
isVisitorMode
()
}
>
<
Only
when=
{
!
userService
.
isVisitorMode
()
}
>
<
button
className=
"btn action-btn"
onClick=
{
handleResourcesBtnClick
}
>
<
button
className=
"btn action-btn"
onClick=
{
handleSettingBtnClick
}
>
<
span
className=
"icon"
>
🌄
</
span
>
{
t
(
"sidebar.resources"
)
}
</
button
>
<
button
className=
"btn action-btn"
onClick=
{
handleMyAccountBtnClick
}
>
<
span
className=
"icon"
>
⚙️
</
span
>
{
t
(
"sidebar.setting"
)
}
<
span
className=
"icon"
>
⚙️
</
span
>
{
t
(
"sidebar.setting"
)
}
</
button
>
</
button
>
<
button
className=
"btn action-btn"
onClick=
{
handleArchivedBtnClick
}
>
<
button
className=
"btn action-btn"
onClick=
{
()
=>
handleExploreBtnClick
()
}
>
<
span
className=
"icon"
>
🗂
</
span
>
{
t
(
"sidebar.archived
"
)
}
<
span
className=
"icon"
>
🏂
</
span
>
{
t
(
"common.explore
"
)
}
</
button
>
</
button
>
</
Only
>
</
Only
>
</
div
>
</
div
>
...
...
web/src/less/explore.less
View file @
b0b2776d
...
@@ -8,10 +8,20 @@
...
@@ -8,10 +8,20 @@
@apply relative w-full min-h-screen mx-auto flex flex-col justify-start items-center;
@apply relative w-full min-h-screen mx-auto flex flex-col justify-start items-center;
> .page-header {
> .page-header {
@apply relative max-w-2xl w-full min-h-full flex flex-row justify-
start items-center px-4 sm:pr-6
;
@apply relative max-w-2xl w-full min-h-full flex flex-row justify-
between items-center px-4 sm:pr-6 mt-6 mb-2
;
> .logo-img {
> .logo-img {
@apply h-14 w-auto mt-6 mb-2;
@apply h-14 w-auto;
}
> .action-button-container {
> .btn {
@apply text-blue-600 py-1 hover:opacity-80;
> .icon {
@apply text-lg mr-1;
}
}
}
}
}
}
...
@@ -42,17 +52,5 @@
...
@@ -42,17 +52,5 @@
}
}
}
}
}
}
> .addtion-btn-container {
@apply fixed bottom-12 left-1/2 -translate-x-1/2;
> .btn {
@apply bg-blue-600 text-white px-4 py-2 rounded-3xl shadow-2xl hover:opacity-80;
> .icon {
@apply text-lg mr-1;
}
}
}
}
}
}
}
web/src/locales/en.json
View file @
b0b2776d
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"archive"
:
"Archive"
,
"archive"
:
"Archive"
,
"basic"
:
"Basic"
,
"basic"
:
"Basic"
,
"admin"
:
"Admin"
,
"admin"
:
"Admin"
,
"explore"
:
"Explore"
,
"sign-in"
:
"Sign in"
,
"sign-in"
:
"Sign in"
,
"sign-out"
:
"Sign out"
,
"sign-out"
:
"Sign out"
,
"back-to-home"
:
"Back to Home"
"back-to-home"
:
"Back to Home"
...
...
web/src/locales/zh.json
View file @
b0b2776d
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"archive"
:
"归档"
,
"archive"
:
"归档"
,
"basic"
:
"基础"
,
"basic"
:
"基础"
,
"admin"
:
"管理员"
,
"admin"
:
"管理员"
,
"explore"
:
"探索"
,
"sign-in"
:
"登录"
,
"sign-in"
:
"登录"
,
"sign-out"
:
"退出登录"
,
"sign-out"
:
"退出登录"
,
"back-to-home"
:
"回到主页"
"back-to-home"
:
"回到主页"
...
...
web/src/pages/Explore.tsx
View file @
b0b2776d
...
@@ -47,6 +47,17 @@ const Explore = () => {
...
@@ -47,6 +47,17 @@ const Explore = () => {
<
div
className=
"page-container"
>
<
div
className=
"page-container"
>
<
div
className=
"page-header"
>
<
div
className=
"page-header"
>
<
img
className=
"logo-img"
src=
"/logo-full.webp"
alt=
""
/>
<
img
className=
"logo-img"
src=
"/logo-full.webp"
alt=
""
/>
<
div
className=
"action-button-container"
>
{
user
?
(
<
button
className=
"btn"
onClick=
{
()
=>
(
window
.
location
.
href
=
"/"
)
}
>
<
span
className=
"icon"
>
🏠
</
span
>
{
t
(
"common.back-to-home"
)
}
</
button
>
)
:
(
<
button
className=
"btn"
onClick=
{
()
=>
(
window
.
location
.
href
=
"/auth"
)
}
>
<
span
className=
"icon"
>
👉
</
span
>
{
t
(
"common.sign-in"
)
}
</
button
>
)
}
</
div
>
</
div
>
</
div
>
<
main
className=
"memos-wrapper"
>
<
main
className=
"memos-wrapper"
>
{
state
.
memos
.
map
((
memo
)
=>
{
{
state
.
memos
.
map
((
memo
)
=>
{
...
@@ -65,18 +76,6 @@ const Explore = () => {
...
@@ -65,18 +76,6 @@ const Explore = () => {
);
);
})
}
})
}
</
main
>
</
main
>
<
div
className=
"addtion-btn-container"
>
{
user
?
(
<
button
className=
"btn"
onClick=
{
()
=>
(
window
.
location
.
href
=
"/"
)
}
>
<
span
className=
"icon"
>
🏠
</
span
>
{
t
(
"common.back-to-home"
)
}
</
button
>
)
:
(
<
button
className=
"btn"
onClick=
{
()
=>
(
window
.
location
.
href
=
"/auth"
)
}
>
<
span
className=
"icon"
>
👉
</
span
>
{
t
(
"common.sign-in"
)
}
</
button
>
)
}
</
div
>
</
div
>
</
div
>
)
}
)
}
</
section
>
</
section
>
...
...
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