common anstasis frame
This commit is contained in:
parent
fbf501e727
commit
3aad5e774d
@ -1,23 +1,13 @@
|
|||||||
import { FunctionalComponent, h } from 'preact';
|
import { FunctionalComponent, h } from "preact";
|
||||||
import { Route, Router } from 'preact-router';
|
|
||||||
|
|
||||||
import Home from '../routes/home';
|
import AnastasisClient from "../routes/home";
|
||||||
import Profile from '../routes/profile';
|
|
||||||
import NotFoundPage from '../routes/notfound';
|
|
||||||
import Header from './header';
|
|
||||||
|
|
||||||
const App: FunctionalComponent = () => {
|
const App: FunctionalComponent = () => {
|
||||||
return (
|
return (
|
||||||
<div id="preact_root">
|
<div id="preact_root">
|
||||||
<Header />
|
<AnastasisClient />
|
||||||
<Router>
|
</div>
|
||||||
<Route path="/" component={Home} />
|
);
|
||||||
<Route path="/profile/" component={Profile} user="me" />
|
|
||||||
<Route path="/profile/:user" component={Profile} />
|
|
||||||
<NotFoundPage default />
|
|
||||||
</Router>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
import { FunctionalComponent, h } from 'preact';
|
|
||||||
import { Link } from 'preact-router/match';
|
|
||||||
import style from './style.css';
|
|
||||||
|
|
||||||
const Header: FunctionalComponent = () => {
|
|
||||||
return (
|
|
||||||
<header class={style.header}>
|
|
||||||
<h1>Preact App</h1>
|
|
||||||
<nav>
|
|
||||||
<Link activeClassName={style.active} href="/">
|
|
||||||
Home
|
|
||||||
</Link>
|
|
||||||
<Link activeClassName={style.active} href="/profile">
|
|
||||||
Me
|
|
||||||
</Link>
|
|
||||||
<Link activeClassName={style.active} href="/profile/john">
|
|
||||||
John
|
|
||||||
</Link>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Header;
|
|
@ -1,48 +0,0 @@
|
|||||||
.header {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 56px;
|
|
||||||
padding: 0;
|
|
||||||
background: #673AB7;
|
|
||||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header h1 {
|
|
||||||
float: left;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 15px;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 56px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #FFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav {
|
|
||||||
float: right;
|
|
||||||
font-size: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a {
|
|
||||||
display: inline-block;
|
|
||||||
height: 56px;
|
|
||||||
line-height: 56px;
|
|
||||||
padding: 0 15px;
|
|
||||||
min-width: 50px;
|
|
||||||
text-align: center;
|
|
||||||
background: rgba(255,255,255,0);
|
|
||||||
text-decoration: none;
|
|
||||||
color: #FFF;
|
|
||||||
will-change: background-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a:hover,
|
|
||||||
.header nav a:active {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a.active {
|
|
||||||
background: rgba(0,0,0,0.4);
|
|
||||||
}
|
|
@ -11,6 +11,7 @@ export interface ReducerStateBackup {
|
|||||||
code: undefined;
|
code: undefined;
|
||||||
continents: any;
|
continents: any;
|
||||||
countries: any;
|
countries: any;
|
||||||
|
identity_attributes?: { [n: string]: string };
|
||||||
authentication_providers: any;
|
authentication_providers: any;
|
||||||
authentication_methods?: AuthMethod[];
|
authentication_methods?: AuthMethod[];
|
||||||
required_attributes: any;
|
required_attributes: any;
|
||||||
@ -39,14 +40,60 @@ export interface AuthMethod {
|
|||||||
challenge: string;
|
challenge: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ChallengeInfo {
|
||||||
|
cost: string;
|
||||||
|
instructions: string;
|
||||||
|
type: string;
|
||||||
|
uuid: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ReducerStateRecovery {
|
export interface ReducerStateRecovery {
|
||||||
backup_state: undefined;
|
backup_state: undefined;
|
||||||
recovery_state: RecoveryStates;
|
recovery_state: RecoveryStates;
|
||||||
code: undefined;
|
code: undefined;
|
||||||
|
|
||||||
|
identity_attributes?: { [n: string]: string };
|
||||||
|
|
||||||
continents: any;
|
continents: any;
|
||||||
countries: any;
|
countries: any;
|
||||||
required_attributes: any;
|
required_attributes: any;
|
||||||
|
|
||||||
|
recovery_information?: {
|
||||||
|
challenges: ChallengeInfo[];
|
||||||
|
policies: {
|
||||||
|
/**
|
||||||
|
* UUID of the associated challenge.
|
||||||
|
*/
|
||||||
|
uuid: string;
|
||||||
|
}[][];
|
||||||
|
};
|
||||||
|
|
||||||
|
recovery_document?: {
|
||||||
|
secret_name: string;
|
||||||
|
provider_url: string;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
selected_challenge_uuid?: string;
|
||||||
|
|
||||||
|
challenge_feedback?: { [uuid: string]: ChallengeFeedback };
|
||||||
|
|
||||||
|
core_secret?: {
|
||||||
|
mime: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
authentication_providers?: {
|
||||||
|
[url: string]: {
|
||||||
|
business_name: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
recovery_error: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChallengeFeedback {
|
||||||
|
state: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReducerStateError {
|
export interface ReducerStateError {
|
||||||
@ -76,6 +123,11 @@ export enum RecoveryStates {
|
|||||||
ContinentSelecting = "CONTINENT_SELECTING",
|
ContinentSelecting = "CONTINENT_SELECTING",
|
||||||
CountrySelecting = "COUNTRY_SELECTING",
|
CountrySelecting = "COUNTRY_SELECTING",
|
||||||
UserAttributesCollecting = "USER_ATTRIBUTES_COLLECTING",
|
UserAttributesCollecting = "USER_ATTRIBUTES_COLLECTING",
|
||||||
|
SecretSelecting = "SECRET_SELECTING",
|
||||||
|
ChallengeSelecting = "CHALLENGE_SELECTING",
|
||||||
|
ChallengePaying = "CHALLENGE_PAYING",
|
||||||
|
ChallengeSolving = "CHALLENGE_SOLVING",
|
||||||
|
RecoveryFinished = "RECOVERY_FINISHED",
|
||||||
}
|
}
|
||||||
|
|
||||||
const reducerBaseUrl = "http://localhost:5000/";
|
const reducerBaseUrl = "http://localhost:5000/";
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
.home {
|
.home {
|
||||||
padding: 56px 20px;
|
padding: 1em 1em;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user