Skip to content

Commit ca5ee50

Browse files
committed
Merge branch 'dev' into release
2 parents 8e8cbf9 + c77a8b1 commit ca5ee50

File tree

3 files changed

+64
-14
lines changed

3 files changed

+64
-14
lines changed

web/app/routes/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Route } from "./+types/home";
1+
import type { Route } from "./+types/app";
22
import Settings from "components/settings";
33
import Setting from "components/setting";
44
import {
@@ -102,7 +102,7 @@ export function meta({ data }: Route.MetaArgs) {
102102
return [{ title: title }, { name: "description", content: description }];
103103
}
104104

105-
export default function Home({ loaderData }: Route.ComponentProps) {
105+
export default function App({ loaderData }: Route.ComponentProps) {
106106
const { background, logo, title, sub_title, description } = loaderData as unknown as Design;
107107

108108

web/app/routes/home.module.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
flex-direction: column;
66
height: 100%;
77
width: 100%;
8+
background-image: url('/images/background.jpg');
9+
background-color: $color-background-overlay;
10+
background-position: top left;
11+
background-repeat: no-repeat;
12+
background-size: cover;
13+
background-blend-mode: darken;
814
}
915

1016
.root {
@@ -23,12 +29,6 @@
2329
left: 0;
2430
right: 0;
2531
bottom: 0;
26-
background-image: url('/images/background.jpg');
27-
background-color: $color-background-overlay;
28-
background-position: top left;
29-
background-repeat: no-repeat;
30-
background-size: cover;
31-
background-blend-mode: darken;
3232
z-index: -1;
3333
}
3434
}

web/app/routes/home.tsx

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,67 @@
1-
import MicIcon from '../../components/micicon';
2-
import styles from './home.module.scss';
1+
import { DesignConfiguration, type Design } from "store/design";
2+
import MicIcon from "../../components/micicon";
3+
import styles from "./home.module.scss";
4+
import type { Route } from "../+types/root";
5+
6+
export async function loader({ params }: Route.LoaderArgs) {
7+
const designConfig = new DesignConfiguration();
8+
try {
9+
const defaultDesign = await designConfig.fetchDefaultDesign();
10+
return defaultDesign;
11+
} catch (error) {
12+
console.error("Error fetching default design:", error);
13+
}
14+
// You can perform any data fetching or initialization here
15+
// For example, you might want to fetch user data or initial settings
16+
const design: Design = {
17+
id: "default",
18+
background: "/images/background.jpg",
19+
default: true,
20+
logo: "",
21+
title: "BuildEvents",
22+
sub_title: "by Contoso",
23+
description: "Making Things Happen since 1935",
24+
};
25+
26+
return design;
27+
}
28+
29+
export function meta({ data }: Route.MetaArgs) {
30+
if (!data) {
31+
return [
32+
{ title: "BuildEvents by Contoso" },
33+
{ name: "description", content: "Making Things Happen since 1935" },
34+
];
35+
}
36+
const title = `${data["title"] || "BuildEvents"} ${
37+
data["sub_title"] || "by Contoso"
38+
}`;
39+
const description = data["description"] || "Making Things Happen since 1935";
40+
return [{ title: title }, { name: "description", content: description }];
41+
}
42+
43+
export default function Home({ loaderData }: Route.ComponentProps) {
44+
const { background, logo, title, sub_title, description } =
45+
loaderData as unknown as Design;
46+
347

4-
export default function Landing() {
548
return (
6-
<div className={styles.landing}>
49+
<div
50+
className={styles.landing}
51+
style={{ backgroundImage: `url('${background}')` }}
52+
>
753
<div className={styles.root}>
854
<div className={styles.container}>
9-
<h1>What can we<br />start working on?</h1>
55+
<h1>
56+
What can we
57+
<br />
58+
start working on?
59+
</h1>
1060
<p>Talk through your ideas and let's make them reality.</p>
1161
</div>
1262
<a href="/app">
1363
<div className={styles.micContainer}>
14-
<MicIcon
64+
<MicIcon
1565
className={styles.micIcon}
1666
role="button"
1767
aria-label="Start recording"

0 commit comments

Comments
 (0)