From 86e9c711a7b9f342f47cca849416d30f20708135 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 3 Apr 2020 20:52:13 -0500 Subject: [PATCH] Render login form --- app/gabsocial/features/auth_login/index.js | 31 +++++++++++++++++++ app/gabsocial/features/ui/index.js | 5 +++ .../features/ui/util/async-components.js | 4 +++ 3 files changed, 40 insertions(+) create mode 100644 app/gabsocial/features/auth_login/index.js diff --git a/app/gabsocial/features/auth_login/index.js b/app/gabsocial/features/auth_login/index.js new file mode 100644 index 000000000..55d65e8cd --- /dev/null +++ b/app/gabsocial/features/auth_login/index.js @@ -0,0 +1,31 @@ +import React from 'react'; +import ImmutablePureComponent from 'react-immutable-pure-component'; + +export default class LoginForm extends ImmutablePureComponent { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + + getFormData(form) { + return Object.fromEntries( + Array.from(form).map(i => [i.name, i.value]) + ); + } + + handleSubmit(event) { + const {username, password} = this.getFormData(event.target); + console.log(username + ' ' + password); + event.preventDefault(); + } + + render() { + return ( +
+ + + +
+ ) + } +} diff --git a/app/gabsocial/features/ui/index.js b/app/gabsocial/features/ui/index.js index ab9c35dcc..006528c91 100644 --- a/app/gabsocial/features/ui/index.js +++ b/app/gabsocial/features/ui/index.js @@ -64,6 +64,7 @@ import { GroupRemovedAccounts, GroupCreate, GroupEdit, + LoginForm, } from './util/async-components'; import { meUsername } from '../../initial_state'; import { previewState as previewMediaState } from './components/media_modal'; @@ -186,6 +187,10 @@ class SwitchingColumnsArea extends React.PureComponent { return ( + {/* */} + + {/* */} + diff --git a/app/gabsocial/features/ui/util/async-components.js b/app/gabsocial/features/ui/util/async-components.js index f84982a92..38b5ea6bb 100644 --- a/app/gabsocial/features/ui/util/async-components.js +++ b/app/gabsocial/features/ui/util/async-components.js @@ -157,3 +157,7 @@ export function Search () { export function Explore () { return import(/* webpackChunkName: "features/explore" */'../../explore'); } + +export function LoginForm () { + return import(/* webpackChunkName: "features/auth_login" */'../../auth_login'); +}