diff --git a/src/LoginGate.tsx b/src/LoginGate.tsx index 3a8e780..4751603 100644 --- a/src/LoginGate.tsx +++ b/src/LoginGate.tsx @@ -81,68 +81,59 @@ function EncryptionPart(props: { credentials: CredentialsType }) { ); } +interface PropsType { + credentials: CredentialsType; +} -class LoginGate extends React.Component { - public props: { - credentials: CredentialsType; - }; - - constructor(props: any) { - super(props); - this.onFormSubmit = this.onFormSubmit.bind(this); - } +export default function LoginGate(props: PropsType) { - public onFormSubmit(username: string, password: string, serviceApiUrl?: string) { + function onFormSubmit(username: string, password: string, serviceApiUrl?: string) { serviceApiUrl = serviceApiUrl ? serviceApiUrl : C.serviceApiBase; store.dispatch(fetchCredentials(username, password, serviceApiUrl)); } - public render() { - if (this.props.credentials.value === null) { - const style = { - isSafe: { - textDecoration: 'none', - display: 'block', - }, - divider: { - margin: '30px 0', - color: '#00000025', - }, - }; - - return ( - -

Please Log In

- -
- - SignedPgaes badge - -
    -
  • - The EteSync Website -
  • -
  • - Is the web client safe to use? -
  • -
  • Source code
  • -
-
- ); - } else if (this.props.credentials.value.encryptionKey === null) { - return ( - - ); - } + if (props.credentials.value === null) { + const style = { + isSafe: { + textDecoration: 'none', + display: 'block', + }, + divider: { + margin: '30px 0', + color: '#00000025', + }, + }; return ( - + +

Please Log In

+ +
+ + SignedPgaes badge + +
    +
  • + The EteSync Website +
  • +
  • + Is the web client safe to use? +
  • +
  • Source code
  • +
+
+ ); + } else if (props.credentials.value.encryptionKey === null) { + return ( + ); } -} -export default LoginGate; + return ( + + ); +}