home.tsx 539 字节
Newer Older
A
Asher 已提交
1
import * as React from "react"
A
Asher 已提交
2
import { Application } from "../../common/api"
A
Asher 已提交
3 4
import { authenticate } from "../api"

A
Asher 已提交
5 6 7 8 9
export interface HomeProps {
  app?: Application
}

export const Home: React.FunctionComponent<HomeProps> = (props) => {
A
Asher 已提交
10
  React.useEffect(() => {
A
Asher 已提交
11
    authenticate().catch(() => undefined)
A
Asher 已提交
12 13 14 15 16
  }, [])

  return (
    <div className="orientation-guide">
      <div className="welcome">Welcome to code-server.</div>
A
Asher 已提交
17
      {props.app && !props.app.loaded ? <div className="loader">loading...</div> : undefined}
A
Asher 已提交
18 19 20
    </div>
  )
}