mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge branch 'chore-admin-file-structure' of gurusainath:makeplane/plane into chore-admin-file-structure
This commit is contained in:
commit
d26c2fd6de
@ -26,43 +26,28 @@ type TTitle = {
|
||||
};
|
||||
|
||||
type THeaderSubheader = {
|
||||
[mode in EAuthModes]: {
|
||||
[step in Exclude<EAuthSteps, EAuthSteps.EMAIL>]: TTitle;
|
||||
};
|
||||
[mode in EAuthModes]: TTitle;
|
||||
};
|
||||
|
||||
const Titles: THeaderSubheader = {
|
||||
const titles: THeaderSubheader = {
|
||||
[EAuthModes.SIGN_IN]: {
|
||||
[EAuthSteps.PASSWORD]: {
|
||||
header: "Sign in to Plane",
|
||||
subHeader: "Get back to your projects and make progress",
|
||||
},
|
||||
[EAuthSteps.UNIQUE_CODE]: {
|
||||
header: "Sign in to Plane",
|
||||
subHeader: "Get back to your projects and make progress",
|
||||
},
|
||||
header: "Sign in to upvote or comment",
|
||||
subHeader: "Contribute in nudging the features you want to get built.",
|
||||
},
|
||||
[EAuthModes.SIGN_UP]: {
|
||||
[EAuthSteps.PASSWORD]: {
|
||||
header: "Create your account",
|
||||
subHeader: "Progress, visualize, and measure work how it works best for you.",
|
||||
},
|
||||
[EAuthSteps.UNIQUE_CODE]: {
|
||||
header: "Create your account",
|
||||
subHeader: "Progress, visualize, and measure work how it works best for you.",
|
||||
},
|
||||
header: "Comment or react to issues",
|
||||
subHeader: "Use plane to add your valuable inputs to features.",
|
||||
},
|
||||
};
|
||||
|
||||
// TODO: Better approach for this.
|
||||
const getHeaderSubHeader = (mode: EAuthModes | null, step: EAuthSteps): TTitle => {
|
||||
const getHeaderSubHeader = (mode: EAuthModes | null): TTitle => {
|
||||
if (mode) {
|
||||
return (Titles[mode] as any)[step];
|
||||
return titles[mode];
|
||||
}
|
||||
|
||||
return {
|
||||
header: "Get started with Plane",
|
||||
subHeader: "Progress, visualize, and measure work how it works best for you.",
|
||||
header: "Comment or react to issues",
|
||||
subHeader: "Use plane to add your valuable inputs to features.",
|
||||
};
|
||||
};
|
||||
|
||||
@ -81,7 +66,7 @@ export const AuthRoot = observer(() => {
|
||||
// derived values
|
||||
const isSmtpConfigured = instance?.config?.is_smtp_configured;
|
||||
|
||||
const { header, subHeader } = getHeaderSubHeader(authMode, authStep);
|
||||
const { header, subHeader } = getHeaderSubHeader(authMode);
|
||||
|
||||
const handelEmailVerification = async (data: IEmailCheckData) => {
|
||||
// update the global email state
|
||||
|
@ -10,10 +10,10 @@ import {
|
||||
AuthHeader,
|
||||
AuthBanner,
|
||||
AuthEmailForm,
|
||||
AuthUniqueCodeForm,
|
||||
AuthPasswordForm,
|
||||
OAuthOptions,
|
||||
TermsAndConditions,
|
||||
UniqueCodeForm,
|
||||
} from "@/components/account";
|
||||
// helpers
|
||||
import {
|
||||
@ -63,7 +63,7 @@ export const SignUpAuthRoot: FC = observer(() => {
|
||||
await authService
|
||||
.signUpEmailCheck(data)
|
||||
.then(() => {
|
||||
if (isSmtpConfigured) setAuthStep(EAuthSteps.UNIQUE_CODE);
|
||||
if (isSmtpConfigured) setAuthStep(EAuthSteps.PASSWORD);
|
||||
else setAuthStep(EAuthSteps.PASSWORD);
|
||||
})
|
||||
.catch((error) => {
|
||||
@ -105,7 +105,7 @@ export const SignUpAuthRoot: FC = observer(() => {
|
||||
)}
|
||||
{authStep === EAuthSteps.EMAIL && <AuthEmailForm defaultEmail={email} onSubmit={handleEmailVerification} />}
|
||||
{authStep === EAuthSteps.UNIQUE_CODE && (
|
||||
<UniqueCodeForm
|
||||
<AuthUniqueCodeForm
|
||||
email={email}
|
||||
handleEmailClear={() => {
|
||||
setEmail("");
|
||||
|
@ -30,7 +30,7 @@ const defaultValues: TUniqueCodeFormValues = {
|
||||
// services
|
||||
const authService = new AuthService();
|
||||
|
||||
export const UniqueCodeForm: React.FC<Props> = (props) => {
|
||||
export const AuthUniqueCodeForm: React.FC<Props> = (props) => {
|
||||
const { email, handleEmailClear, submitButtonText, mode } = props;
|
||||
// states
|
||||
const [uniqueCodeFormData, setUniqueCodeFormData] = useState<TUniqueCodeFormValues>({ ...defaultValues, email });
|
||||
|
Loading…
Reference in New Issue
Block a user