mirror of
https://github.com/AmintaCCCP/GithubStarsManager.git
synced 2025-11-25 02:34:54 +08:00
Merge pull request #23 from VancySavoki/fix/build-and-drag-window
feat(Header): ✨ Add drag and no-drag regions for desktop app
This commit is contained in:
10
.github/workflows/build-desktop.yml
vendored
10
.github/workflows/build-desktop.yml
vendored
@@ -33,8 +33,8 @@ jobs:
|
||||
|
||||
- name: Build web app
|
||||
run: npm run build
|
||||
env:
|
||||
VITE_BASE_PATH: './'
|
||||
# env:
|
||||
# VITE_BASE_PATH: './'
|
||||
|
||||
- name: Verify and fix web build
|
||||
shell: bash
|
||||
@@ -467,6 +467,12 @@ jobs:
|
||||
DEBUG: electron-builder
|
||||
# Linux 特定环境变量
|
||||
ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES: true
|
||||
# macOS signing and notarization
|
||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
||||
- name: List build output
|
||||
shell: bash
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -9,6 +9,7 @@ lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
@@ -23,3 +24,5 @@ dist-ssr
|
||||
*.sln
|
||||
*.sw?
|
||||
.env
|
||||
release
|
||||
electron
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -4162,4 +4162,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ function createWindow() {
|
||||
enableRemoteModule: false,
|
||||
webSecurity: true
|
||||
},
|
||||
icon: path.join(__dirname, '../dist/vite.svg'),
|
||||
icon: path.join(__dirname, '../dist/icon.svg'),
|
||||
titleBarStyle: process.platform === 'darwin' ? 'hiddenInset' : 'default',
|
||||
show: false
|
||||
});
|
||||
|
||||
@@ -98,7 +98,7 @@ export const Header: React.FC = () => {
|
||||
const t = (zh: string, en: string) => language === 'zh' ? zh : en;
|
||||
|
||||
return (
|
||||
<header className="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50">
|
||||
<header className="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50 hd-drag">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="flex items-center justify-between h-16">
|
||||
{/* Logo and Title */}
|
||||
@@ -121,7 +121,7 @@ export const Header: React.FC = () => {
|
||||
</div>
|
||||
|
||||
{/* Navigation */}
|
||||
<nav className="hidden md:flex items-center space-x-1">
|
||||
<nav className="hidden md:flex items-center space-x-1 hd-btns">
|
||||
<button
|
||||
onClick={() => setCurrentView('repositories')}
|
||||
className={`px-4 py-2 rounded-lg font-medium transition-colors ${
|
||||
@@ -158,7 +158,7 @@ export const Header: React.FC = () => {
|
||||
</nav>
|
||||
|
||||
{/* User Actions */}
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className="flex items-center space-x-3 hd-btns">
|
||||
{/* Sync Status */}
|
||||
<div className="hidden sm:flex items-center space-x-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<span>{t('上次同步:', 'Last sync:')} {formatLastSync(lastSync)}</span>
|
||||
|
||||
@@ -9,4 +9,14 @@
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.hd-drag {
|
||||
-webkit-app-region: drag;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.hd-btns {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
plugins: [react()],
|
||||
optimizeDeps: {
|
||||
exclude: ['lucide-react'],
|
||||
|
||||
Reference in New Issue
Block a user