mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-18 19:15:03 +03:00
feat(sidebar): add documentation link button
Add a Docs button next to the donate button in the sidebar and mobile drawer linking to https://docs.sanaei.dev/, with menu.docs translations across all 13 languages.
This commit is contained in:
@@ -75,6 +75,33 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-docs {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
text-decoration: none;
|
||||||
|
flex-shrink: 0;
|
||||||
|
transition: background-color 0.2s, transform 0.15s, color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-docs:hover,
|
||||||
|
.sidebar-docs:focus-visible {
|
||||||
|
background-color: color-mix(in srgb, var(--ant-color-primary) 12%, transparent);
|
||||||
|
color: var(--ant-color-primary);
|
||||||
|
transform: scale(1.08);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-docs .anticon {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-theme-cycle {
|
.sidebar-theme-cycle {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
MessageOutlined,
|
MessageOutlined,
|
||||||
MoonFilled,
|
MoonFilled,
|
||||||
MoonOutlined,
|
MoonOutlined,
|
||||||
|
ReadOutlined,
|
||||||
SafetyOutlined,
|
SafetyOutlined,
|
||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
SunOutlined,
|
SunOutlined,
|
||||||
@@ -40,6 +41,7 @@ import './AppSidebar.css';
|
|||||||
|
|
||||||
const SIDEBAR_COLLAPSED_KEY = 'isSidebarCollapsed';
|
const SIDEBAR_COLLAPSED_KEY = 'isSidebarCollapsed';
|
||||||
const DONATE_URL = 'https://donate.sanaei.dev/';
|
const DONATE_URL = 'https://donate.sanaei.dev/';
|
||||||
|
const DOCS_URL = 'https://docs.sanaei.dev/';
|
||||||
const REPO_URL = 'https://github.com/MHSanaei/3x-ui';
|
const REPO_URL = 'https://github.com/MHSanaei/3x-ui';
|
||||||
const LOGOUT_KEY = '__logout__';
|
const LOGOUT_KEY = '__logout__';
|
||||||
|
|
||||||
@@ -83,6 +85,21 @@ function DonateButton({ ariaLabel }: { ariaLabel: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function DocsButton({ ariaLabel }: { ariaLabel: string }) {
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
href={DOCS_URL}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="sidebar-docs"
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
title={ariaLabel}
|
||||||
|
>
|
||||||
|
<ReadOutlined />
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function VersionBadge({ version, collapsed }: { version: string; collapsed?: boolean }) {
|
function VersionBadge({ version, collapsed }: { version: string; collapsed?: boolean }) {
|
||||||
if (!version) return null;
|
if (!version) return null;
|
||||||
const label = formatPanelVersion(version);
|
const label = formatPanelVersion(version);
|
||||||
@@ -254,6 +271,7 @@ export default function AppSidebar() {
|
|||||||
</div>
|
</div>
|
||||||
{!collapsed && (
|
{!collapsed && (
|
||||||
<div className="brand-actions">
|
<div className="brand-actions">
|
||||||
|
<DocsButton ariaLabel={t('menu.docs') || 'Documentation'} />
|
||||||
<DonateButton ariaLabel={t('menu.donate') || 'Donate'} />
|
<DonateButton ariaLabel={t('menu.donate') || 'Donate'} />
|
||||||
<ThemeCycleButton
|
<ThemeCycleButton
|
||||||
id="theme-cycle"
|
id="theme-cycle"
|
||||||
@@ -306,6 +324,7 @@ export default function AppSidebar() {
|
|||||||
<span className="drawer-brand">3X-UI</span>
|
<span className="drawer-brand">3X-UI</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="drawer-header-actions">
|
<div className="drawer-header-actions">
|
||||||
|
<DocsButton ariaLabel={t('menu.docs') || 'Documentation'} />
|
||||||
<DonateButton ariaLabel={t('menu.donate') || 'Donate'} />
|
<DonateButton ariaLabel={t('menu.donate') || 'Donate'} />
|
||||||
<ThemeCycleButton
|
<ThemeCycleButton
|
||||||
id="theme-cycle-drawer"
|
id="theme-cycle-drawer"
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "تسجيل خروج",
|
"logout": "تسجيل خروج",
|
||||||
"link": "إدارة",
|
"link": "إدارة",
|
||||||
"donate": "تبرع",
|
"donate": "تبرع",
|
||||||
"hosts": "المضيفات"
|
"hosts": "المضيفات",
|
||||||
|
"docs": "التوثيق"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"apiDocs": "API Docs",
|
"apiDocs": "API Docs",
|
||||||
"logout": "Log Out",
|
"logout": "Log Out",
|
||||||
"link": "Manage",
|
"link": "Manage",
|
||||||
"donate": "Donate"
|
"donate": "Donate",
|
||||||
|
"docs": "Documentation"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Cerrar Sesión",
|
"logout": "Cerrar Sesión",
|
||||||
"link": "Gestionar",
|
"link": "Gestionar",
|
||||||
"donate": "Donar",
|
"donate": "Donar",
|
||||||
"hosts": "Hosts"
|
"hosts": "Hosts",
|
||||||
|
"docs": "Documentación"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "خروج",
|
"logout": "خروج",
|
||||||
"link": "مدیریت",
|
"link": "مدیریت",
|
||||||
"donate": "حمایت مالی",
|
"donate": "حمایت مالی",
|
||||||
"hosts": "میزبانها"
|
"hosts": "میزبانها",
|
||||||
|
"docs": "مستندات"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Keluar",
|
"logout": "Keluar",
|
||||||
"link": "Kelola",
|
"link": "Kelola",
|
||||||
"donate": "Donasi",
|
"donate": "Donasi",
|
||||||
"hosts": "Host"
|
"hosts": "Host",
|
||||||
|
"docs": "Dokumentasi"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "ログアウト",
|
"logout": "ログアウト",
|
||||||
"link": "リンク管理",
|
"link": "リンク管理",
|
||||||
"donate": "寄付",
|
"donate": "寄付",
|
||||||
"hosts": "ホスト"
|
"hosts": "ホスト",
|
||||||
|
"docs": "ドキュメント"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Sair",
|
"logout": "Sair",
|
||||||
"link": "Gerenciar",
|
"link": "Gerenciar",
|
||||||
"donate": "Doar",
|
"donate": "Doar",
|
||||||
"hosts": "Hosts"
|
"hosts": "Hosts",
|
||||||
|
"docs": "Documentação"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Выход",
|
"logout": "Выход",
|
||||||
"link": "Управление",
|
"link": "Управление",
|
||||||
"donate": "Поддержать",
|
"donate": "Поддержать",
|
||||||
"hosts": "Хосты"
|
"hosts": "Хосты",
|
||||||
|
"docs": "Документация"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Çıkış Yap",
|
"logout": "Çıkış Yap",
|
||||||
"link": "Yönet",
|
"link": "Yönet",
|
||||||
"donate": "Bağış Yap",
|
"donate": "Bağış Yap",
|
||||||
"hosts": "Host'lar"
|
"hosts": "Host'lar",
|
||||||
|
"docs": "Belgeler"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Вийти",
|
"logout": "Вийти",
|
||||||
"link": "Керувати",
|
"link": "Керувати",
|
||||||
"donate": "Підтримати",
|
"donate": "Підтримати",
|
||||||
"hosts": "Хости"
|
"hosts": "Хости",
|
||||||
|
"docs": "Документація"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "Đăng xuất",
|
"logout": "Đăng xuất",
|
||||||
"link": "Quản lý",
|
"link": "Quản lý",
|
||||||
"donate": "Quyên góp",
|
"donate": "Quyên góp",
|
||||||
"hosts": "Hosts"
|
"hosts": "Hosts",
|
||||||
|
"docs": "Tài liệu"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "退出登录",
|
"logout": "退出登录",
|
||||||
"link": "管理",
|
"link": "管理",
|
||||||
"donate": "捐赠",
|
"donate": "捐赠",
|
||||||
"hosts": "主机"
|
"hosts": "主机",
|
||||||
|
"docs": "文档"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
"logout": "退出登入",
|
"logout": "退出登入",
|
||||||
"link": "管理",
|
"link": "管理",
|
||||||
"donate": "捐贈",
|
"donate": "捐贈",
|
||||||
"hosts": "Hosts"
|
"hosts": "Hosts",
|
||||||
|
"docs": "文件"
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
"login": {
|
"login": {
|
||||||
|
|||||||
Reference in New Issue
Block a user