-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2091 from abilpraju-aot/feature/FWF-3280-landing-…
…page Route for checking multitenant login
- Loading branch information
Showing
7 changed files
with
287 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React, { useState } from "react"; | ||
import { useHistory } from "react-router-dom"; | ||
import "./landingPage.css"; | ||
import { validateTenant } from "../../apiManager/services/tenantServices"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
const LandingPage = () => { | ||
const [username, setUsername] = useState(""); | ||
const [error, setError] = useState(null); | ||
const history = useHistory(); | ||
const { t } = useTranslation(); | ||
|
||
const handleSubmit = (event) => { | ||
event.preventDefault(); | ||
validateTenant(username) | ||
.then((res) => { | ||
if (res.data.status === "INVALID") { | ||
setError(t("Tenant not found")); | ||
} else { | ||
setError(null); // Clear the error if validation is successful | ||
history.push(`/tenant/${username}`); | ||
} | ||
}) | ||
.catch((err) => { | ||
console.error("error", err); | ||
}); | ||
}; | ||
|
||
return ( | ||
<div className="landing"> | ||
<div className="imageContainer"> | ||
<img | ||
src="https://i0.wp.com/formsflow.ai/wp-content/uploads/2021/08/srvc-bnr.png?fit=702%2C569&ssl=1" | ||
alt="Login Image" | ||
className="image" | ||
/> | ||
</div> | ||
<div className="formContainer"> | ||
<div className="innerContainer"> | ||
<img | ||
src="https://149641023.v2.pressablecdn.com/wp-content/uploads/2022/05/Site_logo.png" | ||
alt="formsflow Logo" | ||
className="logo" | ||
/> | ||
<h1 className="heading">{t("Enter your Tenant Name")}</h1> | ||
<form onSubmit={handleSubmit} className="formTenant"> | ||
<div className="formGroupTenant"> | ||
<label htmlFor="username" className="formLabelTenant"> | ||
{t("Please provide your tenant name to sign in")} | ||
</label> | ||
<input | ||
type="text" | ||
id="username" | ||
value={username} | ||
onChange={(e) => setUsername(e.target.value)} | ||
className={`form-control ${error ? "is-invalid" : ""}`} | ||
placeholder="Eg: johndoe" | ||
required | ||
/> | ||
{error && <div className="invalid-feedback">{error}</div>} | ||
</div> | ||
<button | ||
type="submit" | ||
className="btn btn-primary btnTenant" | ||
disabled={!username} | ||
> | ||
{t("Proceed to Sign In")} | ||
</button> | ||
</form> | ||
{/* <div className="lineTenant"></div> | ||
<div className="supportText">{t("Contact formsflow.ai support")}</div> | ||
<div className="supportLink"> | ||
<a href="/contact">[email protected]</a> | ||
</div> */} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LandingPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from "react"; | ||
import LandingPage from "./LandingPage"; | ||
|
||
export default React.memo(() => { | ||
return <LandingPage />; | ||
}); |
117 changes: 117 additions & 0 deletions
117
forms-flow-web/src/components/MultiTenant/landingPage.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
.landing { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100vh; | ||
align-items: center; | ||
} | ||
|
||
.imageContainer { | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-position: left top; | ||
padding: 1rem; | ||
} | ||
|
||
.image { | ||
width: 100%; | ||
max-width: 700px; | ||
object-fit: contain; | ||
} | ||
|
||
.formContainer { | ||
width: 100%; | ||
max-width: 500px; | ||
padding: 5rem; | ||
background-color: #f9f9f9; | ||
box-shadow: 0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), | ||
0 0 0.375rem 0 rgba(3, 3, 3, 0.08); | ||
margin: 1rem auto; | ||
/* border-radius: 8px; */ | ||
} | ||
|
||
.innerContainer { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.logo { | ||
max-width: 150px; | ||
} | ||
|
||
.heading { | ||
margin-bottom: 20px; | ||
font-size: 1.5rem; | ||
text-align: center; | ||
} | ||
|
||
.formTenant { | ||
width: 100%; | ||
} | ||
|
||
.formGroupTenant { | ||
width: 100%; | ||
margin-bottom: 20px; | ||
text-align: left; | ||
} | ||
|
||
.formLabelTenant { | ||
display: block; | ||
margin-bottom: 10px; | ||
font-size: 1rem; | ||
line-height: 1.66666667; | ||
} | ||
|
||
.btnTenant { | ||
display: block; | ||
width: 100%; | ||
margin-bottom: 20px; | ||
padding: 6px 10px; | ||
font-size: 0.875rem; | ||
line-height: 1.3333333; | ||
border-radius: 1px; | ||
} | ||
|
||
.lineTenant { | ||
width: 100%; | ||
height: 1px; | ||
background-color: #ccc; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.supportText { | ||
color: black; | ||
text-align: center; | ||
} | ||
|
||
.supportLink { | ||
text-align: center; | ||
} | ||
|
||
.supportLink a { | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
|
||
.supportLink a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.landing { | ||
flex-direction: row; | ||
justify-content: space-between; | ||
} | ||
|
||
.imageContainer { | ||
flex: 1; | ||
max-width: 50%; | ||
} | ||
|
||
.formContainer { | ||
flex: 1; | ||
margin: auto; | ||
} | ||
} |
Oops, something went wrong.