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
bf46a9af
Unverified
Commit
bf46a9af
authored
Mar 04, 2023
by
boojack
Committed by
GitHub
Mar 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add heat map to sidebar (#1255)
parent
c6d43581
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
14 deletions
+24
-14
Header.tsx
web/src/components/Header.tsx
+1
-1
HomeSidebar.tsx
web/src/components/HomeSidebar.tsx
+5
-3
UsageHeatMap.tsx
web/src/components/UsageHeatMap.tsx
+1
-1
home-sidebar.less
web/src/less/home-sidebar.less
+2
-2
memo.less
web/src/less/memo.less
+1
-1
search-bar.less
web/src/less/search-bar.less
+1
-1
usage-heat-map.less
web/src/less/usage-heat-map.less
+11
-5
en.json
web/src/locales/en.json
+1
-0
zh.json
web/src/locales/zh.json
+1
-0
No files found.
web/src/components/Header.tsx
View file @
bf46a9af
...
...
@@ -64,7 +64,7 @@ const Header = () => {
className=
"px-4 pr-5 py-2 rounded-lg flex flex-row items-center text-lg dark:text-gray-200 hover:bg-white hover:shadow dark:hover:bg-zinc-700"
onClick=
{
()
=>
showArchivedMemoDialog
()
}
>
<
Icon
.
Archive
className=
"mr-4 w-6 h-auto opacity-80"
/>
{
t
(
"common.archive"
)
}
<
Icon
.
Archive
className=
"mr-4 w-6 h-auto opacity-80"
/>
{
t
(
"common.archive
d
"
)
}
</
button
>
<
button
className=
"px-4 pr-5 py-2 rounded-lg flex flex-row items-center text-lg dark:text-gray-200 hover:bg-white hover:shadow dark:hover:bg-zinc-700"
...
...
web/src/components/HomeSidebar.tsx
View file @
bf46a9af
...
...
@@ -4,6 +4,7 @@ import { useLocationStore } from "../store/module";
import
ShortcutList
from
"./ShortcutList"
;
import
TagList
from
"./TagList"
;
import
SearchBar
from
"./SearchBar"
;
import
UsageHeatMap
from
"./UsageHeatMap"
;
import
"../less/home-sidebar.less"
;
const
HomeSidebar
=
()
=>
{
...
...
@@ -17,10 +18,11 @@ const HomeSidebar = () => {
return
(
<>
<
div
className=
"mask"
onClick=
{
()
=>
toggleHomeSidebar
(
false
)
}
></
div
>
<
aside
className=
"sidebar-wrapper"
>
<
div
className=
"pl-6 pr-
2
mb-4 w-full"
>
<
aside
className=
"
home-
sidebar-wrapper"
>
<
div
className=
"pl-6 pr-
4
mb-4 w-full"
>
<
SearchBar
/>
</
div
>
<
UsageHeatMap
/>
<
ShortcutList
/>
<
TagList
/>
</
aside
>
...
...
@@ -29,7 +31,7 @@ const HomeSidebar = () => {
};
export
const
toggleHomeSidebar
=
(
show
?:
boolean
)
=>
{
const
sidebarEl
=
document
.
body
.
querySelector
(
".sidebar-wrapper"
)
as
HTMLDivElement
;
const
sidebarEl
=
document
.
body
.
querySelector
(
".
home-
sidebar-wrapper"
)
as
HTMLDivElement
;
const
maskEl
=
sidebarEl
.
previousSibling
as
HTMLDivElement
;
if
(
isUndefined
(
show
))
{
...
...
web/src/components/UsageHeatMap.tsx
View file @
bf46a9af
...
...
@@ -7,7 +7,7 @@ import * as utils from "../helpers/utils";
import
"../less/usage-heat-map.less"
;
const
tableConfig
=
{
width
:
1
2
,
width
:
1
1
,
height
:
7
,
};
...
...
web/src/less/home-sidebar.less
View file @
bf46a9af
.sidebar-wrapper {
@apply flex-shrink-0 fixed sm:sticky top-0 z-30 sm:z-0 translate-x-56 sm:translate-x-0 hidden md:flex flex-col justify-start items-start w-56 h-full py-4 bg-white dark:bg-zinc-800 sm:bg-transparent overflow-x-hidden overflow-y-auto transition-transform duration-300 overscroll-contain hide-scrollbar;
.
home-
sidebar-wrapper {
@apply flex-shrink-0 fixed sm:sticky top-0 z-30 sm:z-0 translate-x-56 sm:translate-x-0 hidden md:flex flex-col justify-start items-start w-56
md:mr-2
h-full py-4 bg-white dark:bg-zinc-800 sm:bg-transparent overflow-x-hidden overflow-y-auto transition-transform duration-300 overscroll-contain hide-scrollbar;
&.show {
@apply flex translate-x-0 right-0 shadow-2xl sm:shadow-none;
...
...
web/src/less/memo.less
View file @
bf46a9af
...
...
@@ -13,7 +13,7 @@
@apply absolute top-0 right-0 z-1;
&::after {
@apply absolute top-0 right-0 border-transparent border-t-green-600 border-r-green-600 rounded-tr;
@apply absolute top-0 right-0 border-transparent border-t-green-600 border-r-green-600 rounded-tr
-md
;
content: "";
border-width: 6px;
}
...
...
web/src/less/search-bar.less
View file @
bf46a9af
...
...
@@ -15,7 +15,7 @@
}
> .search-bar-inputer {
@apply h-9 flex flex-row justify-start items-center w-full py-2 px-3 sm:px-4 rounded-
full sm:rounded-lg bg-zinc
-200 dark:bg-zinc-700;
@apply h-9 flex flex-row justify-start items-center w-full py-2 px-3 sm:px-4 rounded-
md bg-gray
-200 dark:bg-zinc-700;
> .icon-img {
@apply w-4 h-auto opacity-30 dark:text-gray-200;
...
...
web/src/less/usage-heat-map.less
View file @
bf46a9af
.usage-heat-map-wrapper {
@apply flex flex-row justify-start items-center w-full h-32 flex-wrap pr-6 pb-3 shrink-0;
@apply flex flex-row justify-start items-center flex-nowrap w-full h-32 pr-2 pb-3 shrink-0;
&:hover {
> .day-tip-text-container {
@apply visible;
}
}
> .day-tip-text-container {
@apply w-6 h-full grid grid-rows-7;
@apply w-6 h-full grid grid-rows-7
invisible
;
> .tip-text {
@apply pr-1 w-full h-full text-right font-mono text-gray-400;
...
...
@@ -12,13 +18,13 @@
> .usage-heat-map {
@apply h-full grid grid-rows-7;
width:
200
px;
grid-template-columns: repeat(1
2
, 1fr);
width:
186
px;
grid-template-columns: repeat(1
1
, 1fr);
grid-auto-flow: column;
> .stat-wrapper {
> .stat-container {
@apply block rounded
-sm
bg-gray-200 dark:bg-zinc-700;
@apply block rounded bg-gray-200 dark:bg-zinc-700;
width: 14px;
height: 14px;
...
...
web/src/locales/en.json
View file @
bf46a9af
...
...
@@ -5,6 +5,7 @@
"resources"
:
"Resources"
,
"settings"
:
"Settings"
,
"daily-review"
:
"Daily Review"
,
"archived"
:
"Archived"
,
"email"
:
"Email"
,
"password"
:
"Password"
,
"avatar"
:
"Avatar"
,
...
...
web/src/locales/zh.json
View file @
bf46a9af
...
...
@@ -5,6 +5,7 @@
"resources"
:
"资源库"
,
"settings"
:
"设置"
,
"daily-review"
:
"每日回顾"
,
"archived"
:
"归档"
,
"email"
:
"邮箱"
,
"password"
:
"密码"
,
"username"
:
"用户名"
,
...
...
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