+
{isLoading &&
{i18n.t('loading_text')}
}
- {!isLoading && displayFiles.length >= curSchemeNotesLength && cardNodes.length > 0 &&
{i18n.t('reached_bottom')}
}
+ {!isLoading && displayFiles.length >= curSchemeNotesLength && isNotEmpty &&
{i18n.t('reached_bottom')}
}
{/* 手机端悬浮添加按钮 */}
{Platform.isMobile && (
diff --git a/src/pages/cards/cards.css b/src/pages/cards/cards.css
index ea6d55b..121833b 100644
--- a/src/pages/cards/cards.css
+++ b/src/pages/cards/cards.css
@@ -1,13 +1,24 @@
+.card-note {
+ display: flex;
+ width: 620px;
+}
+
+.card-note.small {
+ width: 100%;
+}
+
.card-note-container {
background: var(--background-secondary);
color: var(--text-normal);
border-radius: 8px;
padding: 16px;
- margin-bottom: 16px;
position: relative;
box-shadow: 0 1px 6px 1px rgba(0, 0, 0, 0.16);
+ width: 620px;
+}
+
+.card-note.small .card-note-container {
width: 100%;
- max-width: 620px;
}
.card-note-content {
diff --git a/src/pages/cards/emptyCard.css b/src/pages/cards/emptyCard.css
index b92846e..165ac27 100644
--- a/src/pages/cards/emptyCard.css
+++ b/src/pages/cards/emptyCard.css
@@ -8,7 +8,6 @@
border-radius: 16px;
box-shadow: 0 1px 6px 1px rgba(0, 0, 0, 0.16);
padding: 48px 24px;
- max-width: 620px;
width: 100%;
}
diff --git a/src/pages/dashboard.css b/src/pages/dashboard.css
index 4fd4341..554d9db 100644
--- a/src/pages/dashboard.css
+++ b/src/pages/dashboard.css
@@ -1,42 +1,55 @@
/* --- 整个面板 --- */
-.dashboard-container {
+.dashboard {
display: flex;
flex-direction: row;
justify-content: center;
height: 100%;
overflow: hidden;
+ width: 100%;
+ max-width: 1590px; /* 16 + 296 + 6 + 620 + 16 + 620 + 16 */
+ margin: 0 auto;
}
/* --- 主内容区 --- */
-.main-container {
+.main {
+ width: fit-content;
+ display: flex;
+ flex-direction: column;
height: 100%;
overflow-y: auto;
scrollbar-width: none;
}
-.main-container::-webkit-scrollbar {
+.main::-webkit-scrollbar {
display: none;
}
+/* 卡片内容区 */
+
+.cards {
+ display: grid;
+ justify-content: start;
+ gap: 16px;
+ margin: 6px 4px 0 4px;
+}
+
+.cards.small {
+ grid-template-columns: 1fr;
+}
+
+.cards.one {
+ grid-template-columns: 620px;
+ max-width: 620px;
+}
+
+.cards.two {
+ grid-template-columns: repeat(2, 620px);
+}
+
/* 桌面设备 */
@media (min-width: 768px) {
- .main-container {
- max-width: 100%;
- min-width: 620px;
- }
- .main-cards {
- display: flex;
- gap: 16px;
- flex: 1;
- margin: 6px 0 0 4px;
- }
-
- .main-cards-column {
- width: 100%;
- min-width: 620px;
- }
}
/* 移动设备 */
@@ -45,19 +58,9 @@
.workspace-leaf-content[data-type="dashboard-view"] .view-content {
padding-bottom: 0 !important;
}
-
- .main-container {
- width: 100%;
- }
-
- .main-cards-column {
- width: 100%;
- min-width: calc(100vw - 24px);
- padding: 0 4px;
- }
}
-.main-cards-loading {
+.cards-loading {
text-align: center;
padding: 20px;
color: var(--text-muted);
diff --git a/src/pages/header/HeaderView.tsx b/src/pages/header/HeaderView.tsx
index d708a09..6665ef4 100644
--- a/src/pages/header/HeaderView.tsx
+++ b/src/pages/header/HeaderView.tsx
@@ -1,15 +1,16 @@
import React from 'react';
import { Icon } from "src/components/Icon";
import { Searchbar } from "./searchbar/Searchbar";
-import { DefaultFilterSchemeID, getDefaultFilterScheme } from "src/models/FilterScheme";
+import { DefaultFilterSchemeID, FilterScheme, getDefaultFilterScheme } from "src/models/FilterScheme";
import { i18n } from "src/utils/i18n";
+import { ViewScheme } from 'src/models/ViewScheme';
interface HeaderViewProps {
showSidebar: 'normal' | 'hide' | 'show';
setShowSidebar: (state: 'normal' | 'hide' | 'show') => void;
- curScheme: any;
- filterSchemes: any[];
- setCurScheme: (scheme: any) => void;
+ curScheme: FilterScheme | ViewScheme;
+ filterSchemes: FilterScheme[];
+ setCurScheme: (scheme: FilterScheme | ViewScheme) => void;
}
export const HeaderView: React.FC
= ({
@@ -20,8 +21,8 @@ export const HeaderView: React.FC = ({
setCurScheme
}) => {
return (
-
-
+
+
{curScheme.id === DefaultFilterSchemeID && (
-
{curScheme.name}
+
{curScheme.name}
)}
{curScheme.id !== DefaultFilterSchemeID && (
-
+
{
setCurScheme(getDefaultFilterScheme(filterSchemes));
}}
>
{getDefaultFilterScheme(filterSchemes).name}
-
{'/'}
-
{curScheme.name}
+
{'/'}
+
{curScheme.name}
)}
diff --git a/src/pages/header/addnote.css b/src/pages/header/addnote.css
index 77cafdd..d031066 100644
--- a/src/pages/header/addnote.css
+++ b/src/pages/header/addnote.css
@@ -9,7 +9,6 @@
position: relative;
box-shadow: 0 1px 6px 1px rgba(0, 0, 0, 0.16);
width: 100%;
- max-width: 620px;
border: 1px solid transparent;
}
@@ -90,6 +89,8 @@
.add-note-send-button {
padding: 6px 15px;
+ width: 48px;
+ align-self: end;
}
.add-note-send-button:hover {
diff --git a/src/pages/header/header.css b/src/pages/header/header.css
index d26d98d..dbd36df 100644
--- a/src/pages/header/header.css
+++ b/src/pages/header/header.css
@@ -1,4 +1,10 @@
-.main-header-container {
+.header {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+}
+
+.header-main {
display: flex;
flex-direction: row;
justify-content: space-between;
@@ -14,62 +20,61 @@
}
/* 主标题 */
-.main-header-title {
+.header-main-title {
display: flex;
align-items: center;
}
-.main-header-title-container {
+.header-main-title-container {
display: flex;
}
-.main-header-add-note-container {
- margin-top: 16px;
- margin: 4px;
+.header-main-add-note-container {
+ margin: 4px 4px 0 4px;
}
-.main-header-title-container {
+.header-main-title-container {
display: flex;
}
-.main-header-title-content {
+.header-main-title-content {
padding: 6px 8px;
color: var(--text-normal);
font-size: var(--font-text-size);
font-weight: var(--font-ui-semibold);
}
-.main-header-title-separator {
+.header-main-title-separator {
padding: 6px 4px;
color: var(--text-faint);
font-size: var(--font-small);
font-weight: var(--font-ui-semibold);
}
-.main-header-title-content-clickable {
+.header-main-title-content-clickable {
cursor: pointer;
}
-.main-header-title-content-clickable:hover {
+.header-main-title-content-clickable:hover {
background: var(--background-secondary);
border-radius: 6px;
}
/* 副标题 */
-.main-subheader-container {
+.header-sub-container {
margin-top: 0;
display: flex;
align-items: baseline;
justify-content: space-between;
}
-.main-subheader-info {
+.header-sub-info {
display: flex;
align-items: center;
}
-.main-subheader-info .refresh-btn {
+.header-sub-info .refresh-btn {
background-color: transparent;
padding: var(--size-2-2) var(--size-2-3);
cursor: pointer;
@@ -77,14 +82,14 @@
}
@media (hover: hover) {
- .main-subheader-info .refresh-btn:hover {
+ .header-sub-info .refresh-btn:hover {
background-color: var(--theme-color-translucent-015);
color: var(--icon-color-hover);
}
}
@media (hover: none) {
- .main-subheader-info .refresh-btn:active {
+ .header-sub-info .refresh-btn:active {
background-color: var(--theme-color-translucent-015);
color: var(--icon-color-hover);
}
@@ -92,13 +97,13 @@
-.main-subheader-loaded-notes {
+.header-sub-loaded-notes {
padding: 12px 6px;
color: var(--text-muted);
font-size: var(--font-smaller);
}
-.main-subheader-btn-section {
+.header-sub-btn-section {
display: flex;
gap: 8px;
}
diff --git a/src/pages/sidebar/SideBarContent.tsx b/src/pages/sidebar/SideBarContent.tsx
index d67934a..60b0018 100644
--- a/src/pages/sidebar/SideBarContent.tsx
+++ b/src/pages/sidebar/SideBarContent.tsx
@@ -20,7 +20,7 @@ export const SidebarContent = () => {
}
return (
-
+
diff --git a/src/pages/sidebar/Sidebar.tsx b/src/pages/sidebar/Sidebar.tsx
index 3e866d4..842ea25 100644
--- a/src/pages/sidebar/Sidebar.tsx
+++ b/src/pages/sidebar/Sidebar.tsx
@@ -1,13 +1,24 @@
import { useEffect } from "react";
+import { SidebarContent } from "./SideBarContent";
interface SidebarProps {
+ showSidebar: 'normal' | 'hide' | 'show';
+ onClose: () => void;
+}
+
+const Sidebar: React.FC
= ({ showSidebar, onClose }) => {
+ if (showSidebar == 'normal') return ;
+ return ;
+}
+
+interface SidebarContainerProps {
visible: boolean;
onClose: () => void;
children?: React.ReactNode;
}
// 侧边栏组件,支持响应式隐藏与展开
-const Sidebar: React.FC = ({ visible, onClose, children }) => {
+const SidebarContainer: React.FC = ({ visible, onClose, children }) => {
// 监听点击遮罩关闭
useEffect(() => {
if (!visible) return;
diff --git a/src/pages/sidebar/sidebar.css b/src/pages/sidebar/sidebar.css
index e51981d..5716f28 100644
--- a/src/pages/sidebar/sidebar.css
+++ b/src/pages/sidebar/sidebar.css
@@ -12,8 +12,8 @@
.sidebar-container {
position: absolute;
height: 100%;
- background: var(--background-secondary, #222);
- color: var(--text-normal, #fff);
+ background: var(--background-secondary);
+ color: var(--text-normal);
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
z-index: 1001;
transition: left 0.25s cubic-bezier(.4, 0, .2, 1);
@@ -43,7 +43,7 @@
/* 侧边栏内容 */
-.sidebar-content-container {
+.sidebar-content {
display: flex;
flex-direction: column;
padding: 0 16px 50px 16px;
@@ -55,7 +55,7 @@
scrollbar-width: none;
}
-.sidebar-content-container::-webkit-scrollbar {
+.sidebar-content::-webkit-scrollbar {
display: none;
}