-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use help modal instead of inline text
- Loading branch information
1 parent
b6821d1
commit d348c79
Showing
6 changed files
with
64 additions
and
30 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script lang="ts"> | ||
// This launches a modal when clicked. The user should put the modal contents | ||
// as a slot beneath this component. | ||
import icon from "../../assets/help.svg?url"; | ||
import { Modal } from "svelte-utils"; | ||
let show = false; | ||
</script> | ||
|
||
<button on:click={() => (show = true)}> | ||
<img src={icon} title="Help" alt="Help" /> | ||
</button> | ||
|
||
{#if show} | ||
<Modal on:close={() => (show = false)}> | ||
<h2>Help</h2> | ||
<slot /> | ||
</Modal> | ||
{/if} | ||
|
||
<style> | ||
button { | ||
background: none; | ||
border: 1px solid rgba(0, 0, 0, 0); | ||
} | ||
button:hover { | ||
border: 1px solid black; | ||
} | ||
</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
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