Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
feat(StandAloneFormPage): Made the logo variable
Browse files Browse the repository at this point in the history
Made the logo variable by passing it in LoginPage/registerPage/ForgotPasswordPage
  • Loading branch information
meiremans committed Feb 27, 2019
1 parent 0928f51 commit 2d9d48e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
57 changes: 29 additions & 28 deletions src/page_templates/StandaloneFormPage.react.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
// @flow

import * as React from "react";

type Props = {|
+children?: React.Node,
|};

function StandaloneFormPage(props: Props): React.Node {
return (
<div className="page">
<div className="page-single">
<div className="container">
<div className="row">
<div className="col col-login mx-auto">
<div className="text-center mb-6">
<img src="./assets/brand/tabler.svg" className="h-6" alt="" />
</div>
{props.children}
</div>
</div>
</div>
</div>
</div>
);
}

export default StandaloneFormPage;
// @flow

import * as React from "react";

type Props = {|
+children?: React.Node,
+imageURL?: string,
|};

function StandaloneFormPage(props: Props): React.Node {
return (
<div className="page">
<div className="page-single">
<div className="container">
<div className="row">
<div className="col col-login mx-auto">
<div className="text-center mb-6">
<img src={props.imageURL} className="h-6" alt="logo" />
</div>
{props.children}
</div>
</div>
</div>
</div>
</div>
);
}

export default StandaloneFormPage;
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function ForgotPasswordPage(props: Props): React.Node {
} = props;

return (
<StandaloneFormPage>
<StandaloneFormPage imageURL={"./demo/logo.svg"}>
<FormCard
buttonText={strings.buttonText || defaultStrings.buttonText}
title={strings.title || defaultStrings.title}
Expand All @@ -72,8 +72,8 @@ function ForgotPasswordPage(props: Props): React.Node {
);
}

const ForgotPasswordPageWithTouchedErrors: React.ComponentType<
Props
> = withTouchedErrors(["email"])(ForgotPasswordPage);
const ForgotPasswordPageWithTouchedErrors: React.ComponentType<Props> = withTouchedErrors(
["email"]
)(ForgotPasswordPage);

export default ForgotPasswordPageWithTouchedErrors;
8 changes: 4 additions & 4 deletions src/page_templates/account/LoginPage/LoginPage.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function LoginPage(props: Props): React.Node {
} = props;

return (
<StandaloneFormPage>
<StandaloneFormPage imageURL={"./demo/logo.svg"}>
<FormCard
buttonText={strings.buttonText || defaultStrings.buttonText}
title={strings.title || defaultStrings.title}
Expand Down Expand Up @@ -83,8 +83,8 @@ function LoginPage(props: Props): React.Node {
);
}

const LoginPageWithTouchedErrors: React.ComponentType<
Props
> = withTouchedErrors(["email", "password"])(LoginPage);
const LoginPageWithTouchedErrors: React.ComponentType<Props> = withTouchedErrors(
["email", "password"]
)(LoginPage);

export default LoginPageWithTouchedErrors;
8 changes: 4 additions & 4 deletions src/page_templates/account/RegisterPage/RegisterPage.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function RegisterPage(props: Props): React.Node {
} = props;

return (
<StandaloneFormPage>
<StandaloneFormPage imageURL={"./demo/logo.svg"}>
<FormCard
buttonText={strings.buttonText || defaultStrings.buttonText}
title={strings.title || defaultStrings.title}
Expand Down Expand Up @@ -111,8 +111,8 @@ function RegisterPage(props: Props): React.Node {
);
}

const RegisterPageWithTouchedErrors: React.ComponentType<
Props
> = withTouchedErrors(["name", "email", "password", "terms"])(RegisterPage);
const RegisterPageWithTouchedErrors: React.ComponentType<Props> = withTouchedErrors(
["name", "email", "password", "terms"]
)(RegisterPage);

export default RegisterPageWithTouchedErrors;

0 comments on commit 2d9d48e

Please sign in to comment.