Skip to content

Commit

Permalink
⚡ make app page title dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
zcubbs committed May 20, 2024
1 parent f869a3d commit 6f11898
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/start/public/env.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
window.VITE_API_URL = '${VITE_API_URL}';
window.VITE_APP_LOGO_URL = '${VITE_APP_LOGO_URL}';
window.VITE_APP_TITLE = '${VITE_APP_TITLE}';
3 changes: 2 additions & 1 deletion web/start/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Separator} from "@/components/ui/separator.tsx";
const App: React.FC = () => {
const [blueprints, setBlueprints] = useState<Blueprint[]>([]);
useEffect(() => {
document.title = window.VITE_APP_TITLE || 'Power - Starters';
fetchBlueprints().then(setBlueprints);
}, []);

Expand Down Expand Up @@ -52,7 +53,7 @@ const App: React.FC = () => {
</span>
</div>
<Separator/>
<h2 className="text-3xl font-bold mt-10 mb-10">Blueprints</h2>
<h2 className="text-3xl font-bold mt-10 mb-10">Plugins</h2>
{blueprints && blueprints.length > 0 ? getBlueprints() : getNoBlueprints()}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/start/src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ declare global {
interface Window {
VITE_APP_LOGO_URL?: string;
VITE_API_URL?: string;
VITE_APP_TITLE?: string;
}
}

Expand Down

0 comments on commit 6f11898

Please sign in to comment.