Skip to content

Commit

Permalink
update solid components and fm in the template
Browse files Browse the repository at this point in the history
  • Loading branch information
kasinskas committed Sep 29, 2023
1 parent 2b017f0 commit 438c521
Showing 1 changed file with 57 additions and 52 deletions.
109 changes: 57 additions & 52 deletions packages/template-starter/src/app/index.lng.jsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,67 @@
import { Text, useFocusManager, View } from "@lightningjs/solid";
import { Route, Routes, useNavigate } from "@solidjs/router";
import { Text, View } from '@lightningjs/solid';
import { useFocusManager } from '@lightningjs/solid-primitives';
import { Route, Routes, useNavigate } from '@solidjs/router';

const HelloWorld = () => {
return (
<>
<Text
autofocus
style={{
width: 1920,
height: 170,
lineHeight: 170,
y: 455,
contain: "both",
fontSize: 100,
textAlign: "center",
}}
>
Hello World!
</Text>
<Text
style={{
width: 1920,
height: 170,
lineHeight: 170,
y: 655,
contain: "both",
fontSize: 60,
textAlign: "center",
}}
>
Press B for buttons, T for Text pages, M for here
</Text>
</>
);
return (
<>
<Text
autofocus
style={{
width: 1920,
height: 170,
lineHeight: 170,
y: 455,
contain: 'both',
fontSize: 100,
textAlign: 'center',
}}
>
Hello World!
</Text>
<Text
style={{
width: 1920,
height: 170,
lineHeight: 170,
y: 655,
contain: 'both',
fontSize: 60,
textAlign: 'center',
}}
>
Press B for buttons, T for Text pages, M for here
</Text>
</>
);
};
const App = () => {
useFocusManager();
const navigate = useNavigate();
useFocusManager({
m: 'Menu',
t: 'Text',
b: 'Buttons',
});
const navigate = useNavigate();

return (
<View
ref={window.APP}
aria-label={"Hello World"}
onLast={() => history.back()}
onText={() => navigate("/text")}
onButtons={() => navigate("/buttons")}
onMenu={() => navigate("/")}
style={{ width: 1920, height: 1080 }}
>
<View color="#071423" style={{ width: 1920, height: 1080 }} />
<Routes>
<Route path="/" component={HelloWorld} />
{/* <Route path="/text" component={TextPage} />
return (
<View
ref={window.APP}
aria-label={'Hello World'}
onLast={() => history.back()}
onText={() => navigate('/text')}
onButtons={() => navigate('/buttons')}
onMenu={() => navigate('/')}
style={{ width: 1920, height: 1080 }}
>
<View color="#071423" style={{ width: 1920, height: 1080 }} />
<Routes>
<Route path="/" component={HelloWorld} />
{/* <Route path="/text" component={TextPage} />
<Route path="/buttons" component={ButtonsPage} />
<Route path="/*all" component={NotFound} /> */}
</Routes>
</View>
);
</Routes>
</View>
);
};

export default App;

0 comments on commit 438c521

Please sign in to comment.