@@ -47,7 +47,10 @@ function App() {
|
|||||||
<Routes>
|
<Routes>
|
||||||
<Route exact path="/" element={<Homepage />} />
|
<Route exact path="/" element={<Homepage />} />
|
||||||
<Route exact path="/login" element={<Login />} />
|
<Route exact path="/login" element={<Login />} />
|
||||||
<Route path="/signup" element={<SignupPage />} />
|
<Route
|
||||||
|
path="/signup/:isUpgrade?/:currentPlan?"
|
||||||
|
element={<SignupPage />}
|
||||||
|
/>
|
||||||
<Route path="/requestpage/:supReq" element={<DemoRequestPage />} />
|
<Route path="/requestpage/:supReq" element={<DemoRequestPage />} />
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
|
|||||||
@@ -77,8 +77,11 @@ const CaseDetailsPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleConfirmUpgrade = () => {
|
const handleConfirmUpgrade = () => {
|
||||||
console.log("handle confirm upgrade");
|
const isUpgrade = true;
|
||||||
|
const currentPlan = group?.subscriptionPlan;
|
||||||
|
navigate(`/signup/${isUpgrade}/${currentPlan}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSuccess = () => {
|
const handleSuccess = () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setShowUploadModal(false);
|
setShowUploadModal(false);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Col from "react-bootstrap/Col";
|
|||||||
import Form from "react-bootstrap/Form";
|
import Form from "react-bootstrap/Form";
|
||||||
import Row from "react-bootstrap/Row";
|
import Row from "react-bootstrap/Row";
|
||||||
import Button from "../../pageElements/Button";
|
import Button from "../../pageElements/Button";
|
||||||
|
import { useParams } from "react-router-dom";
|
||||||
import { db, auth } from "../../firebase";
|
import { db, auth } from "../../firebase";
|
||||||
import { createUserWithEmailAndPassword } from "firebase/auth";
|
import { createUserWithEmailAndPassword } from "firebase/auth";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@@ -30,8 +31,8 @@ import "../../styles/signup.scss";
|
|||||||
import Stripe from "stripe";
|
import Stripe from "stripe";
|
||||||
import { stripeApiKey } from "../../secrets";
|
import { stripeApiKey } from "../../secrets";
|
||||||
|
|
||||||
const SignupPage = (props) => {
|
const SignupPage = () => {
|
||||||
const { isUpgrade } = props;
|
const { isUpgrade, currentPlan } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [notice, setNotice] = useState("");
|
const [notice, setNotice] = useState("");
|
||||||
const fieldsChunkSize = 2;
|
const fieldsChunkSize = 2;
|
||||||
@@ -41,7 +42,9 @@ const SignupPage = (props) => {
|
|||||||
getFormDataDefaults(paymentfields)
|
getFormDataDefaults(paymentfields)
|
||||||
);
|
);
|
||||||
const [showPaymentModal, setShowPaymentModal] = useState(false);
|
const [showPaymentModal, setShowPaymentModal] = useState(false);
|
||||||
const [showSelectPlan, setShowSelectPlan] = useState(false);
|
const [showSelectPlan, setShowSelectPlan] = useState(
|
||||||
|
isUpgrade ? true : false
|
||||||
|
);
|
||||||
const [activeRadioOption, setActiveRadioOption] = useState("partner");
|
const [activeRadioOption, setActiveRadioOption] = useState("partner");
|
||||||
const [selectedPlan, setSelectedPlan] = useState([signupRadioFields[1]]);
|
const [selectedPlan, setSelectedPlan] = useState([signupRadioFields[1]]);
|
||||||
const [isAnnual, setIsAnnual] = useState(1);
|
const [isAnnual, setIsAnnual] = useState(1);
|
||||||
@@ -201,6 +204,7 @@ const SignupPage = (props) => {
|
|||||||
email,
|
email,
|
||||||
customerId: customerId,
|
customerId: customerId,
|
||||||
subscriptionId: subscriptionId,
|
subscriptionId: subscriptionId,
|
||||||
|
subscriptionPlan: plan,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -379,97 +383,101 @@ const SignupPage = (props) => {
|
|||||||
selectedPlan[0].value === "seniorPartner" ||
|
selectedPlan[0].value === "seniorPartner" ||
|
||||||
selectedPlan[0].value === "partner";
|
selectedPlan[0].value === "partner";
|
||||||
|
|
||||||
|
const signupForm = (
|
||||||
|
<div className="signup-sub-container">
|
||||||
|
<div className="signup-header">
|
||||||
|
<h1 className="signup-header-text">Create a Novodraft account</h1>
|
||||||
|
</div>
|
||||||
|
<Form className="signup-form">
|
||||||
|
{splitEvery(
|
||||||
|
Object.keys(signupFields).slice(0, -2),
|
||||||
|
fieldsChunkSize
|
||||||
|
).map((names, j) => (
|
||||||
|
<Row key={`row${j}`}>
|
||||||
|
{names.map((name, i) => (
|
||||||
|
<Col key={`${name}${i + fieldsChunkSize * j}`} className="mb-3">
|
||||||
|
<TextInput
|
||||||
|
name={name}
|
||||||
|
value={data[name].value}
|
||||||
|
onChange={(e) => handleChangeInput(e, name)}
|
||||||
|
error={data[name].error}
|
||||||
|
message={data[name].message}
|
||||||
|
label={
|
||||||
|
data[name].value.length === 0
|
||||||
|
? signupFields[name].label
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
type={signupFields[name].type}
|
||||||
|
values={signupFields[name].values}
|
||||||
|
disabled={isBusy}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
))}
|
||||||
|
</Row>
|
||||||
|
))}
|
||||||
|
<Row>
|
||||||
|
<Col className="mb-3">
|
||||||
|
<TextInput
|
||||||
|
id="signupPassword"
|
||||||
|
type="password"
|
||||||
|
label={
|
||||||
|
data.password.value.length === 0
|
||||||
|
? signupFields.password.label
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
value={data.password.value}
|
||||||
|
error={data.password.error}
|
||||||
|
message={data.password.message}
|
||||||
|
onChange={(e) => handleChangeInput(e, "password")}
|
||||||
|
disabled={isBusy}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col className="mb-3">
|
||||||
|
<TextInput
|
||||||
|
id="confirmPassword"
|
||||||
|
type="password"
|
||||||
|
label={
|
||||||
|
data.confirmPassword.value.length === 0
|
||||||
|
? signupFields.confirmPassword.label
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
value={data.confirmPassword.value}
|
||||||
|
error={data.confirmPassword.error}
|
||||||
|
message={data.confirmPassword.message}
|
||||||
|
onChange={(e) => handleChangeInput(e, "confirmPassword")}
|
||||||
|
disabled={isBusy}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Form>
|
||||||
|
<div className="signup-button-box">
|
||||||
|
<Button
|
||||||
|
className="primary-button signup-proceed"
|
||||||
|
type="button"
|
||||||
|
size="lg"
|
||||||
|
onClick={handleOpenSelectPlan}
|
||||||
|
disabled={isBusy}
|
||||||
|
labelText="Select A Plan"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{showNoticeOnPage ? (
|
||||||
|
<>
|
||||||
|
<br></br>
|
||||||
|
<div className="alert alert-danger" role="alert">
|
||||||
|
{notice}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
const magicIndex = currentPlan === "associate" ? 1 : 2;
|
||||||
return (
|
return (
|
||||||
<div className="signup-super-container">
|
<div className="signup-super-container">
|
||||||
<div className="signup-sub-container">
|
{!isUpgrade ? signupForm : <></>}
|
||||||
<div className="signup-header">
|
|
||||||
<h1 className="signup-header-text">Create a Novodraft account</h1>
|
|
||||||
</div>
|
|
||||||
<Form className="signup-form">
|
|
||||||
{splitEvery(
|
|
||||||
Object.keys(signupFields).slice(0, -2),
|
|
||||||
fieldsChunkSize
|
|
||||||
).map((names, j) => (
|
|
||||||
<Row key={`row${j}`}>
|
|
||||||
{names.map((name, i) => (
|
|
||||||
<Col key={`${name}${i + fieldsChunkSize * j}`} className="mb-3">
|
|
||||||
<TextInput
|
|
||||||
name={name}
|
|
||||||
value={data[name].value}
|
|
||||||
onChange={(e) => handleChangeInput(e, name)}
|
|
||||||
error={data[name].error}
|
|
||||||
message={data[name].message}
|
|
||||||
label={
|
|
||||||
data[name].value.length === 0
|
|
||||||
? signupFields[name].label
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
type={signupFields[name].type}
|
|
||||||
values={signupFields[name].values}
|
|
||||||
disabled={isBusy}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
))}
|
|
||||||
</Row>
|
|
||||||
))}
|
|
||||||
<Row>
|
|
||||||
<Col className="mb-3">
|
|
||||||
<TextInput
|
|
||||||
id="signupPassword"
|
|
||||||
type="password"
|
|
||||||
label={
|
|
||||||
data.password.value.length === 0
|
|
||||||
? signupFields.password.label
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
value={data.password.value}
|
|
||||||
error={data.password.error}
|
|
||||||
message={data.password.message}
|
|
||||||
onChange={(e) => handleChangeInput(e, "password")}
|
|
||||||
disabled={isBusy}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<Col className="mb-3">
|
|
||||||
<TextInput
|
|
||||||
id="confirmPassword"
|
|
||||||
type="password"
|
|
||||||
label={
|
|
||||||
data.confirmPassword.value.length === 0
|
|
||||||
? signupFields.confirmPassword.label
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
value={data.confirmPassword.value}
|
|
||||||
error={data.confirmPassword.error}
|
|
||||||
message={data.confirmPassword.message}
|
|
||||||
onChange={(e) => handleChangeInput(e, "confirmPassword")}
|
|
||||||
disabled={isBusy}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Form>
|
|
||||||
<div className="signup-button-box">
|
|
||||||
<Button
|
|
||||||
className="primary-button signup-proceed"
|
|
||||||
type="button"
|
|
||||||
size="lg"
|
|
||||||
onClick={handleOpenSelectPlan}
|
|
||||||
disabled={isBusy}
|
|
||||||
labelText="Select A Plan"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{showNoticeOnPage ? (
|
|
||||||
<>
|
|
||||||
<br></br>
|
|
||||||
<div className="alert alert-danger" role="alert">
|
|
||||||
{notice}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{showSelectPlan ? (
|
{showSelectPlan ? (
|
||||||
<div className="select-plan-container">
|
<div className="select-plan-container">
|
||||||
<div className="select-sub-left">
|
<div className="select-sub-left">
|
||||||
@@ -488,7 +496,7 @@ const SignupPage = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="radio-group-box">
|
<div className="radio-group-box">
|
||||||
{signupRadioFields?.map((option, i) => (
|
{signupRadioFields?.map((option, index) => (
|
||||||
<div className="signup-radio-container">
|
<div className="signup-radio-container">
|
||||||
<Radio
|
<Radio
|
||||||
onClick={handleChangeRadioInput}
|
onClick={handleChangeRadioInput}
|
||||||
@@ -499,6 +507,9 @@ const SignupPage = (props) => {
|
|||||||
activeRadioOption={activeRadioOption}
|
activeRadioOption={activeRadioOption}
|
||||||
price={option.pricing}
|
price={option.pricing}
|
||||||
isAnnual={isAnnual}
|
isAnnual={isAnnual}
|
||||||
|
isUpgrade={index < magicIndex ? true : false}
|
||||||
|
disabled={index < magicIndex ? true : false}
|
||||||
|
currentPlan={currentPlan}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -13,22 +13,26 @@ const Radio = (props) => {
|
|||||||
activeRadioOption,
|
activeRadioOption,
|
||||||
details,
|
details,
|
||||||
isAnnual,
|
isAnnual,
|
||||||
|
isUpgrade,
|
||||||
|
currentPlan,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const classCheckbox = "checkbox";
|
const classCheckbox = "checkbox";
|
||||||
const classOption = "option";
|
const classOption = "option";
|
||||||
const index = isAnnual === 1 ? Number("1") : Number("0");
|
const index = isAnnual === 1 ? Number("1") : Number("0");
|
||||||
|
|
||||||
|
const upgradeClass = isUpgrade ? "upgrade" : "not-upgrade";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="radio-container">
|
<div className="radio-container">
|
||||||
<div className="radio-option-container" key={name}>
|
<div className="radio-option-container" key={name}>
|
||||||
<>
|
<>
|
||||||
<div className="radio-circle-container">
|
<div className={`radio-circle-container ${upgradeClass}`}>
|
||||||
<div
|
<div
|
||||||
className="radio-circle-top"
|
className="radio-circle-top"
|
||||||
onClick={() => !disabled && onClick && onClick(value)}
|
onClick={() => !disabled && onClick && onClick(value)}
|
||||||
>
|
>
|
||||||
{value == activeRadioOption ? (
|
{value == activeRadioOption && !isUpgrade ? (
|
||||||
<div className="radio-circle-box">
|
<div className="radio-circle-box">
|
||||||
<CircleFill color="#1a76c7" size="20px" />
|
<CircleFill color="#1a76c7" size="20px" />
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +52,7 @@ const Radio = (props) => {
|
|||||||
<div className="radio-description-box">
|
<div className="radio-description-box">
|
||||||
{description.map((item, i) => {
|
{description.map((item, i) => {
|
||||||
const el =
|
const el =
|
||||||
item == "First month free!" ? (
|
item == "First month free!" && !isUpgrade ? (
|
||||||
<div className="offer-div">
|
<div className="offer-div">
|
||||||
<p className="signup-feat-item-bold">{item}</p>
|
<p className="signup-feat-item-bold">{item}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
.radio-circle-container {
|
.radio-circle-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #fff;
|
&.upgrade {
|
||||||
|
background-color: rgb(149, 149, 149);
|
||||||
|
}
|
||||||
|
&.not-upgrade {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
height: 290px;
|
height: 290px;
|
||||||
margin: 10px 8px 0px 8px;
|
margin: 10px 8px 0px 8px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
Reference in New Issue
Block a user