-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luke Carr
committed
Apr 5, 2022
1 parent
5d9f340
commit 0e93526
Showing
4 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import Header from 'src/components/Header' | ||
import Router from 'src/components/Router' | ||
import Welcome from 'src/components/Welcome' | ||
import Footer from './components/Footer' | ||
|
||
export function App() { | ||
return ( | ||
<div class="min-h-screen"> | ||
<div class="min-h-screen flex flex-col"> | ||
<Header /> | ||
<main class="container max-w-screen-md my-8"> | ||
<main class="container max-w-screen-md my-8 flex-1"> | ||
<Welcome /> | ||
<Router /> | ||
</main> | ||
<Footer /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import useSWR from 'swr' | ||
|
||
import type { FunctionalComponent } from 'preact' | ||
|
||
const fetcher = (url: string) => fetch(url).then(r => r.json()) | ||
|
||
const BuildInfo: FunctionalComponent = () => { | ||
const { data, error } = useSWR<{ | ||
version: string | ||
date: string | ||
commit: string | ||
}>('/api/version', fetcher) | ||
|
||
if (error) return null | ||
if (!data) return null | ||
|
||
return <div class="text-gray-700 text-sm font-mono text-right"> | ||
<p>{data.version}</p> | ||
<p>Build date: {data.date}</p> | ||
<p>Commit: {data.commit}</p> | ||
</div> | ||
} | ||
|
||
const Footer: FunctionalComponent = () => { | ||
return <footer class="border-t-1 border-gray-400 py-8"> | ||
<div class="container max-w-screen-md flex justify-between"> | ||
<p>Made with ❤ by <a class="font-semibold underline underline-dotted hover:underline-solid" href="https://github.com/lukecarr" target="_blank" rel="noopener">Luke Carr</a></p> | ||
<BuildInfo /> | ||
</div> | ||
</footer> | ||
} | ||
|
||
export default Footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters