-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement header and layout in page.svelte
- Loading branch information
Showing
6 changed files
with
67 additions
and
1 deletion.
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
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,8 +1,30 @@ | ||
<script> | ||
import './styles.css'; | ||
import {hmsActions} from "./hms.ts"; | ||
import Conference from "./Conference.svelte"; | ||
import JoinForm from "./JoinForm.svelte"; | ||
import Header from "./Header.svelte"; | ||
import Footer from "./Footer.svelte"; | ||
import {hmsIsConnected} from "./hmsStores.ts"; | ||
function leaveRoom() { | ||
hmsActions.leave(); | ||
} | ||
</script> | ||
|
||
<!-- leave room on tab close --> | ||
<svelte:window on:unload={leaveRoom} /> | ||
|
||
<svelte:head> | ||
<title>100ms Svelte App</title> | ||
<meta name="description" content="Svelte HMS World" /> | ||
</svelte:head> | ||
|
||
<Header/> | ||
{#if $hmsIsConnected} | ||
<Conference /> | ||
{:else} | ||
<JoinForm /> | ||
{/if} | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Conference</p> |
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,30 @@ | ||
<script> | ||
import {hmsIsConnected} from "./hmsStores.ts"; | ||
import {hmsActions} from "./hms.ts"; | ||
function leaveRoom() { | ||
hmsActions.leave(); | ||
} | ||
</script> | ||
|
||
|
||
<header> | ||
<img | ||
class="logo" | ||
src="https://www.100ms.live/assets/logo.svg" | ||
alt="100ms Logo" | ||
/> | ||
|
||
{#if hmsIsConnected} | ||
<button id="leave-btn" class="btn-danger" on:click={leaveRoom}> Leave Room </button> | ||
{/if} | ||
</header> | ||
|
||
<style> | ||
header { | ||
padding: 10px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
</style> |
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 @@ | ||
<p>Join Form</p> |
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