2020-02-05 02:27:46 +07:00
|
|
|
import * as React from "react"
|
2020-02-05 07:16:45 +07:00
|
|
|
import { Application } from "../../common/api"
|
2020-02-05 02:27:46 +07:00
|
|
|
import { authenticate } from "../api"
|
|
|
|
|
2020-02-05 07:16:45 +07:00
|
|
|
export interface HomeProps {
|
|
|
|
app?: Application
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Home: React.FunctionComponent<HomeProps> = (props) => {
|
2020-02-05 02:27:46 +07:00
|
|
|
React.useEffect(() => {
|
2020-02-05 07:16:45 +07:00
|
|
|
authenticate().catch(() => undefined)
|
2020-02-05 02:27:46 +07:00
|
|
|
}, [])
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="orientation-guide">
|
|
|
|
<div className="welcome">Welcome to code-server.</div>
|
2020-02-05 07:16:45 +07:00
|
|
|
{props.app && !props.app.loaded ? <div className="loader">loading...</div> : undefined}
|
2020-02-05 02:27:46 +07:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|