From 0dfdea0e4e0ecdf221449a38921e701d728a93b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Curcio?= Date: Thu, 9 Aug 2018 13:17:45 -0300 Subject: [PATCH] Auth Views --- src/core/client/auth/components/App.tsx | 13 +++- .../client/auth/components/ForgotPassword.css | 9 +++ .../client/auth/components/ForgotPassword.tsx | 37 ++++++++++ .../client/auth/components/ResetPassword.css | 9 +++ .../client/auth/components/ResetPassword.tsx | 38 ++++++++++ src/core/client/auth/components/SignIn.css | 7 ++ src/core/client/auth/components/SignIn.tsx | 24 ++++--- src/core/client/auth/components/SignUp.css | 6 ++ src/core/client/auth/components/SignUp.tsx | 71 +++++++++++-------- .../containers/ForgotPasswordContainer.tsx | 10 +++ .../containers/ResetPasswordContainer.tsx | 10 +++ .../stream/containers/UserBoxContainer.tsx | 2 +- .../ui/components/TextField/TextField.css | 2 + 13 files changed, 198 insertions(+), 40 deletions(-) create mode 100644 src/core/client/auth/components/ForgotPassword.css create mode 100644 src/core/client/auth/components/ForgotPassword.tsx create mode 100644 src/core/client/auth/components/ResetPassword.css create mode 100644 src/core/client/auth/components/ResetPassword.tsx create mode 100644 src/core/client/auth/containers/ForgotPasswordContainer.tsx create mode 100644 src/core/client/auth/containers/ResetPasswordContainer.tsx diff --git a/src/core/client/auth/components/App.tsx b/src/core/client/auth/components/App.tsx index 7de209ae6..4fe34d3a1 100644 --- a/src/core/client/auth/components/App.tsx +++ b/src/core/client/auth/components/App.tsx @@ -1,13 +1,20 @@ import * as React from "react"; import { StatelessComponent } from "react"; +import ForgotPasswordContainer from "../containers/ForgotPasswordContainer"; +import ResetPasswordContainer from "../containers/ResetPasswordContainer"; import SignInContainer from "../containers/SignInContainer"; import SignUpContainer from "../containers/SignUpContainer"; export interface AppProps { // TODO: (cvle) Remove %future added value when we have Relay 1.6 // https://github.com/facebook/relay/commit/1e87e43add7667a494f7ff4cfa7f03f1ab8d81a2 - view: "SIGN_UP" | "SIGN_IN" | "FORGOT_PASSWORD" | "%future added value"; + view: + | "SIGN_UP" + | "SIGN_IN" + | "FORGOT_PASSWORD" + | "RESET_PASSWORD" + | "%future added value"; } const App: StatelessComponent = ({ view }) => { @@ -16,6 +23,10 @@ const App: StatelessComponent = ({ view }) => { return ; case "SIGN_IN": return ; + case "FORGOT_PASSWORD": + return ; + case "RESET_PASSWORD": + return ; default: return ; } diff --git a/src/core/client/auth/components/ForgotPassword.css b/src/core/client/auth/components/ForgotPassword.css new file mode 100644 index 000000000..8489081c1 --- /dev/null +++ b/src/core/client/auth/components/ForgotPassword.css @@ -0,0 +1,9 @@ +.root { + width: 330px; + padding-top: calc(5 * var(--spacing-unit)); +} + +.footer { + padding-top: var(--spacing-unit); + width: 100%; +} diff --git a/src/core/client/auth/components/ForgotPassword.tsx b/src/core/client/auth/components/ForgotPassword.tsx new file mode 100644 index 000000000..1c60ea9c6 --- /dev/null +++ b/src/core/client/auth/components/ForgotPassword.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; +import { StatelessComponent } from "react"; +import * as styles from "./SignIn.css"; + +import { + Button, + Flex, + FormField, + InputLabel, + TextField, + Typography, +} from "talk-ui/components"; + +const ForgotPassword: StatelessComponent = props => { + return ( + + + Forgot Password + + + Enter your email address below and we will send you a link to reset your + password. + + + Email Address + + +
+ +
+
+ ); +}; + +export default ForgotPassword; diff --git a/src/core/client/auth/components/ResetPassword.css b/src/core/client/auth/components/ResetPassword.css new file mode 100644 index 000000000..8489081c1 --- /dev/null +++ b/src/core/client/auth/components/ResetPassword.css @@ -0,0 +1,9 @@ +.root { + width: 330px; + padding-top: calc(5 * var(--spacing-unit)); +} + +.footer { + padding-top: var(--spacing-unit); + width: 100%; +} diff --git a/src/core/client/auth/components/ResetPassword.tsx b/src/core/client/auth/components/ResetPassword.tsx new file mode 100644 index 000000000..5f000d091 --- /dev/null +++ b/src/core/client/auth/components/ResetPassword.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; +import { StatelessComponent } from "react"; +import * as styles from "./SignIn.css"; + +import { + Button, + Flex, + FormField, + InputLabel, + TextField, + Typography, +} from "talk-ui/components"; + +const ResetPassword: StatelessComponent = props => { + return ( + + + Reset Password + + + Password + Must be at least 8 characters + + + + Confirm Password + + +
+ +
+
+ ); +}; + +export default ResetPassword; diff --git a/src/core/client/auth/components/SignIn.css b/src/core/client/auth/components/SignIn.css index 9aff9cb83..8110981fc 100644 --- a/src/core/client/auth/components/SignIn.css +++ b/src/core/client/auth/components/SignIn.css @@ -1,7 +1,14 @@ .root { width: 330px; + padding-top: calc(5 * var(--spacing-unit)); } .forgotPassword { text-align: right; } + +.footer, +.subFooter { + padding-top: var(--spacing-unit); + width: 100%; +} diff --git a/src/core/client/auth/components/SignIn.tsx b/src/core/client/auth/components/SignIn.tsx index 97dfdb477..9244aa2af 100644 --- a/src/core/client/auth/components/SignIn.tsx +++ b/src/core/client/auth/components/SignIn.tsx @@ -25,20 +25,26 @@ const SignIn: StatelessComponent = props => { Password - - - - Sign up and join the conversation - - + + Don't have an account? + + + ); }; diff --git a/src/core/client/auth/components/SignUp.css b/src/core/client/auth/components/SignUp.css index 667e35b7a..2b939d10f 100644 --- a/src/core/client/auth/components/SignUp.css +++ b/src/core/client/auth/components/SignUp.css @@ -1,3 +1,9 @@ .root { width: 330px; } + +.footer, +.subFooter { + padding-top: var(--spacing-unit); + width: 100%; +} diff --git a/src/core/client/auth/components/SignUp.tsx b/src/core/client/auth/components/SignUp.tsx index 73a01ec63..9473d2167 100644 --- a/src/core/client/auth/components/SignUp.tsx +++ b/src/core/client/auth/components/SignUp.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { StatelessComponent } from "react"; -import * as styles from "./SignIn.css"; +import * as styles from "./SignUp.css"; import { Button, @@ -14,38 +14,51 @@ import { const SignUp: StatelessComponent = props => { return ( - - Sign up to join the conversation - - - - Email Address - - - - - Username - - A unique identifier displayed on your comments. You may use “_” and - “.” + + + Sign up to join the conversation - - - - Password - Must be at least 8 characters - - + + Email Address + + - - Confirm Password - - + + Username + + A unique identifier displayed on your comments. You may use “_” and + “.” + + + - + + Password + Must be at least 8 characters + + + + + Confirm Password + + + +
+ + + Already have an account? + + +
); }; diff --git a/src/core/client/auth/containers/ForgotPasswordContainer.tsx b/src/core/client/auth/containers/ForgotPasswordContainer.tsx new file mode 100644 index 000000000..b364e7e9e --- /dev/null +++ b/src/core/client/auth/containers/ForgotPasswordContainer.tsx @@ -0,0 +1,10 @@ +import * as React from "react"; +import { StatelessComponent } from "react"; + +import ForgotPassword from "../components/ForgotPassword"; + +const ForgotPasswordContainer: StatelessComponent = () => { + return ; +}; + +export default ForgotPasswordContainer; diff --git a/src/core/client/auth/containers/ResetPasswordContainer.tsx b/src/core/client/auth/containers/ResetPasswordContainer.tsx new file mode 100644 index 000000000..6dab0eef1 --- /dev/null +++ b/src/core/client/auth/containers/ResetPasswordContainer.tsx @@ -0,0 +1,10 @@ +import * as React from "react"; +import { StatelessComponent } from "react"; + +import ResetPassword from "../components/ResetPassword"; + +const ResetPasswordContainer: StatelessComponent = () => { + return ; +}; + +export default ResetPasswordContainer; diff --git a/src/core/client/stream/containers/UserBoxContainer.tsx b/src/core/client/stream/containers/UserBoxContainer.tsx index 176a28eea..fca219660 100644 --- a/src/core/client/stream/containers/UserBoxContainer.tsx +++ b/src/core/client/stream/containers/UserBoxContainer.tsx @@ -37,7 +37,7 @@ export class UserBoxContainer extends Component {