Skip to content

Commit

Permalink
[web] add #network-indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
juzybits committed Oct 20, 2023
1 parent 098a668 commit 3ab09a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions web/src/App.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,29 @@ body {
}

#page {
background-color: #eee;
margin: 0 auto;
max-width: 800px;
min-height: 100vh;
margin: 0 auto;
padding: 1.2em;
background-color: #eee;
padding: 2rem 1.2rem;
position: relative;
}

h1 {
text-align: center;
}

#network-indicator {
background: #222;
border-radius: 6px;
color: white;
font-family: monospace;
padding: 0.15rem 0.4rem;
position: absolute;
right: 1rem;
top: 0.8rem;
}

.section {
display: flex;
flex-direction: column;
Expand Down
6 changes: 5 additions & 1 deletion web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import { useEffect, useState } from 'react';
import './App.less';
import config from './config.json';

const NETWORK = 'devnet';
const MAX_EPOCH = 2; // keep ephemeral keys active for this many Sui epochs from now (1 epoch ~= 24h)

const suiClient = new SuiClient({
url: getFullnodeUrl('devnet'),
url: getFullnodeUrl(NETWORK),
});

/* Local storage keys */
Expand Down Expand Up @@ -312,6 +313,9 @@ export const App: React.FC = () =>
const openIdProviders: OpenIdProvider[] = ['google', 'twitch', 'facebook'];
return (
<div id='page'>
<div id='network-indicator'>
<label>{NETWORK}</label>
</div>
<h1>Sui zkLogin demo</h1>
<div id='login-buttons' className='section'>
<h2>Log in:</h2>
Expand Down

0 comments on commit 3ab09a9

Please sign in to comment.