diff --git a/frontend/src/pages/Preview/FileSharePage.jsx b/frontend/src/pages/Preview/FileSharePage.jsx index 15655f2..a511eb0 100644 --- a/frontend/src/pages/Preview/FileSharePage.jsx +++ b/frontend/src/pages/Preview/FileSharePage.jsx @@ -120,16 +120,19 @@ function FileSharePage() { return (
-
-
-

{shareInfo?.name || '文件分享'}

- {shareInfo?.project_name &&

{shareInfo.project_name}

} -
-
- +
+ +

{contentInfo?.filename || shareInfo?.name || '文件分享'}

+
{loading ? (
diff --git a/frontend/src/pages/Preview/PreviewPage.css b/frontend/src/pages/Preview/PreviewPage.css index 852169a..a84923b 100644 --- a/frontend/src/pages/Preview/PreviewPage.css +++ b/frontend/src/pages/Preview/PreviewPage.css @@ -16,31 +16,10 @@ background: var(--bg-color); } -.file-share-header { +.file-share-content-header { display: flex; align-items: center; - justify-content: space-between; - gap: 16px; - padding: 18px 24px; - border-bottom: 1px solid var(--border-color); - background: var(--header-bg); -} - -.file-share-meta { - min-width: 0; -} - -.file-share-meta h1 { - margin: 0; - font-size: 20px; - font-weight: 700; - color: var(--text-color); -} - -.file-share-meta p { - margin: 4px 0 0; - font-size: 13px; - color: var(--text-color-secondary); + gap: 14px; } .file-share-content { @@ -62,12 +41,38 @@ flex: none; } +.project-back-button { + width: 28px; + height: 28px; + border: none; + border-radius: 999px; + display: inline-flex; + align-items: center; + justify-content: center; + background: transparent; + color: #707480; + font-size: 16px; + cursor: pointer; + flex-shrink: 0; + transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; +} + +.project-back-button:hover { + background: rgba(17, 24, 39, 0.06); + color: #2f3440; + transform: translateX(-1px); +} + +.project-back-button:focus-visible { + outline: 2px solid rgba(22, 119, 255, 0.35); + outline-offset: 2px; +} + .preview-sider-title-row { display: flex; align-items: center; - justify-content: space-between; gap: 12px; - margin-bottom: 8px; + min-width: 0; } .preview-layout { @@ -85,22 +90,24 @@ } .preview-sider-header { - padding: 16px; + min-height: 57px; + padding: 14px 24px; border-bottom: 1px solid var(--border-color); + background: var(--header-bg); + display: flex; + align-items: center; } .preview-sider-header h2 { - margin: 0 0 8px 0; - font-size: 18px; + margin: 0; + font-size: 16px; font-weight: 600; color: var(--text-color); -} - -.preview-project-desc { - margin: 0; - font-size: 13px; - color: var(--text-color-secondary); - line-height: 1.5; + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .preview-search { @@ -228,6 +235,29 @@ background: var(--bg-color); } +.preview-content-header { + position: sticky; + top: 0; + z-index: 5; + min-height: 57px; + padding: 14px 24px; + border-bottom: 1px solid var(--border-color); + background: var(--header-bg); + display: flex; + align-items: center; +} + +.preview-content-header h3 { + margin: 0; + font-size: 16px; + font-weight: 600; + color: var(--text-color); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 100%; +} + .preview-content-wrapper { max-width: 900px; margin: 0 auto; diff --git a/frontend/src/pages/Preview/ProjectSharePage.jsx b/frontend/src/pages/Preview/ProjectSharePage.jsx index 8c56a05..f708765 100644 --- a/frontend/src/pages/Preview/ProjectSharePage.jsx +++ b/frontend/src/pages/Preview/ProjectSharePage.jsx @@ -381,9 +381,6 @@ function ProjectSharePage() { open={mobileDrawerVisible} width="80%" > -
- {projectInfo?.description &&

{projectInfo.description}

} -
-

{projectInfo?.name || '项目分享'}

- +

{projectInfo?.name || '项目分享'}

- {projectInfo?.description &&

{projectInfo.description}

}
+
+

{selectedFile || 'README.md'}

+
{loading ? (