Skip to content

Commit 6f11898

Browse files
committed
⚡ make app page title dynamic
1 parent f869a3d commit 6f11898

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

web/start/public/env.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
window.VITE_API_URL = '${VITE_API_URL}';
22
window.VITE_APP_LOGO_URL = '${VITE_APP_LOGO_URL}';
3+
window.VITE_APP_TITLE = '${VITE_APP_TITLE}';

web/start/src/App.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {Separator} from "@/components/ui/separator.tsx";
1111
const App: React.FC = () => {
1212
const [blueprints, setBlueprints] = useState<Blueprint[]>([]);
1313
useEffect(() => {
14+
document.title = window.VITE_APP_TITLE || 'Power - Starters';
1415
fetchBlueprints().then(setBlueprints);
1516
}, []);
1617

@@ -52,7 +53,7 @@ const App: React.FC = () => {
5253
</span>
5354
</div>
5455
<Separator/>
55-
<h2 className="text-3xl font-bold mt-10 mb-10">Blueprints</h2>
56+
<h2 className="text-3xl font-bold mt-10 mb-10">Plugins</h2>
5657
{blueprints && blueprints.length > 0 ? getBlueprints() : getNoBlueprints()}
5758
</div>
5859
</div>

web/start/src/globals.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ declare global {
33
interface Window {
44
VITE_APP_LOGO_URL?: string;
55
VITE_API_URL?: string;
6+
VITE_APP_TITLE?: string;
67
}
78
}
89

0 commit comments

Comments
 (0)