feat: highlight json

- update svelte to 3.23.0
- add svelte highlight
- add highlight to home page json.
This commit is contained in:
Darrel O'Pry 2020-05-28 12:39:48 -04:00
parent c6f7bcef5f
commit b7d9c345fa
3 changed files with 92 additions and 7 deletions

View file

@ -1,4 +1,7 @@
<script>
import { Highlight } from 'svelte-highlight';
import { json } from 'svelte-highlight/languages';
import { arduinoLight as highlightTheme } from "svelte-highlight/styles";
import {
OidcContext,
authError,
@ -12,6 +15,10 @@ import {
} from './components/components.module.js';
</script>
<svelte:head>
{@html highlightTheme}
</svelte:head>
<div class="container">
<OidcContext
issuer="process.env.OIDC_ISSUER"
@ -31,7 +38,7 @@ import {
<tr><td>isAuthenticated</td><td>{$isAuthenticated}</td></tr>
<tr><td>accessToken</td><td>{$accessToken}</td></tr>
<tr><td>idToken</td><td style="word-break: break-all;">{$idToken}</td></tr>
<tr><td>userInfo</td><td><pre>{JSON.stringify($userInfo, null, 2)}<pre></td></tr>
<tr><td>userInfo</td><td><Highlight language={json} code={JSON.stringify($userInfo, null, 2) || ''} /></td></tr>
<tr><td>authError</td><td>{$authError}</td></tr>
</tbody>
</table>