mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
- Introduced a new command for fetching and validating GitHub issues, allowing users to address issues directly from the command line. - Added a release command to bump the version of the application and build the Electron app, ensuring version consistency across UI and server packages. - Updated package.json files for both UI and server to version 0.7.1, reflecting the latest changes. - Implemented version utility in the server to read the version from package.json, enhancing version management across the application.
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { useMemo } from 'react';
|
|
import { useAppStore, defaultBackgroundSettings } from '@/store/app-store';
|
|
import { getServerUrlSync } from '@/lib/http-api-client';
|
|
|
|
interface UseBoardBackgroundProps {
|
|
currentProject: { path: string; id: string } | null;
|
|
}
|
|
|
|
export function useBoardBackground({ currentProject }: UseBoardBackgroundProps) {
|
|
const boardBackgroundByProject = useAppStore((state) => state.boardBackgroundByProject);
|
|
|
|
// Get background settings for current project
|
|
const backgroundSettings = useMemo(() => {
|
|
return (
|
|
(currentProject && boardBackgroundByProject[currentProject.path]) || defaultBackgroundSettings
|
|
);
|
|
}, [currentProject, boardBackgroundByProject]);
|
|
|
|
// Build background image style if image exists
|
|
const backgroundImageStyle = useMemo(() => {
|
|
if (!backgroundSettings.imagePath || !currentProject) {
|
|
return {};
|
|
}
|
|
|
|
return {
|
|
backgroundImage: `url(${
|
|
import.meta.env.VITE_SERVER_URL || getServerUrlSync()
|
|
}/api/fs/image?path=${encodeURIComponent(
|
|
backgroundSettings.imagePath
|
|
)}&projectPath=${encodeURIComponent(currentProject.path)}${
|
|
backgroundSettings.imageVersion ? `&v=${backgroundSettings.imageVersion}` : ''
|
|
})`,
|
|
backgroundSize: 'cover',
|
|
backgroundPosition: 'center',
|
|
backgroundRepeat: 'no-repeat',
|
|
} as React.CSSProperties;
|
|
}, [backgroundSettings, currentProject]);
|
|
|
|
return {
|
|
backgroundSettings,
|
|
backgroundImageStyle,
|
|
};
|
|
}
|