Fix i18n TOC and PP

pull/11421/merge^2
Sean Brydon 2023-10-18 14:20:47 +01:00
parent 366696e696
commit 5d794efcae
2 changed files with 62 additions and 62 deletions

View File

@ -307,61 +307,63 @@ export default function Signup({ prepopulateFormValues, token, orgSlug }: Signup
</div> </div>
</div> </div>
{/* Social Logins */} {/* Social Logins */}
<div className="mt-6 grid gap-2 md:grid-cols-2"> {!token && (
<Button <div className="mt-6 grid gap-2 md:grid-cols-2">
color="secondary" <Button
disabled={!!formMethods.formState.errors.username} color="secondary"
className={classNames( disabled={!!formMethods.formState.errors.username}
"w-full justify-center rounded-md text-center", className={classNames(
formMethods.formState.errors.username ? "opacity-50" : "" "w-full justify-center rounded-md text-center",
)} formMethods.formState.errors.username ? "opacity-50" : ""
onClick={async () => { )}
if (!formMethods.getValues("username")) { onClick={async () => {
formMethods.trigger("username"); if (!formMethods.getValues("username")) {
return; formMethods.trigger("username");
} return;
const username = formMethods.getValues("username"); }
const searchQueryParams = new URLSearchParams(); const username = formMethods.getValues("username");
searchQueryParams.set("username", formMethods.getValues("username")); const searchQueryParams = new URLSearchParams();
const baseUrl = process.env.NEXT_PUBLIC_WEBAPP_URL; searchQueryParams.set("username", formMethods.getValues("username"));
localStorage.setItem("username", username); const baseUrl = process.env.NEXT_PUBLIC_WEBAPP_URL;
// @NOTE: don't remove username query param as it's required right now for stripe payment page localStorage.setItem("username", username);
const googleAuthUrl = `${baseUrl}/auth/sso/google?${searchQueryParams.toString()}`; // @NOTE: don't remove username query param as it's required right now for stripe payment page
const googleAuthUrl = `${baseUrl}/auth/sso/google?${searchQueryParams.toString()}`;
router.push(googleAuthUrl); router.push(googleAuthUrl);
}}> }}>
<img className="text-emphasis mr-2 h-5 w-5" src="/google-icon.svg" alt="" /> <img className="text-emphasis mr-2 h-5 w-5" src="/google-icon.svg" alt="" />
Google Google
</Button> </Button>
<Button <Button
color="secondary" color="secondary"
disabled={!!formMethods.formState.errors.username || !!formMethods.formState.errors.email} disabled={!!formMethods.formState.errors.username || !!formMethods.formState.errors.email}
className={classNames( className={classNames(
"w-full justify-center rounded-md text-center", "w-full justify-center rounded-md text-center",
formMethods.formState.errors.username && formMethods.formState.errors.email formMethods.formState.errors.username && formMethods.formState.errors.email
? "opacity-50" ? "opacity-50"
: "" : ""
)} )}
onClick={() => { onClick={() => {
if (!formMethods.getValues("username")) { if (!formMethods.getValues("username")) {
formMethods.trigger("username"); formMethods.trigger("username");
} }
if (!formMethods.getValues("email")) { if (!formMethods.getValues("email")) {
formMethods.trigger("email"); formMethods.trigger("email");
return; return;
} }
const username = formMethods.getValues("username"); const username = formMethods.getValues("username");
localStorage.setItem("username", username); localStorage.setItem("username", username);
const sp = new URLSearchParams(); const sp = new URLSearchParams();
// @NOTE: don't remove username query param as it's required right now for stripe payment page // @NOTE: don't remove username query param as it's required right now for stripe payment page
sp.set("username", formMethods.getValues("username")); sp.set("username", formMethods.getValues("username"));
sp.set("email", formMethods.getValues("email")); sp.set("email", formMethods.getValues("email"));
router.push(`${process.env.NEXT_PUBLIC_WEBAPP_URL}/auth/sso/saml` + `?${sp.toString()}`); router.push(`${process.env.NEXT_PUBLIC_WEBAPP_URL}/auth/sso/saml` + `?${sp.toString()}`);
}}> }}>
<ShieldCheckIcon className="mr-2 h-5 w-5" /> <ShieldCheckIcon className="mr-2 h-5 w-5" />
{t("saml_sso")} {t("saml_sso")}
</Button> </Button>
</div> </div>
)}
</div> </div>
{/* Already have an account & T&C */} {/* Already have an account & T&C */}
<div className="mt-6"> <div className="mt-6">
@ -369,19 +371,17 @@ export default function Signup({ prepopulateFormValues, token, orgSlug }: Signup
<Link href="/auth/login" className="text-emphasis hover:underline"> <Link href="/auth/login" className="text-emphasis hover:underline">
{t("already_have_account")} {t("already_have_account")}
</Link> </Link>
<p className="text-subtle"> <div className="text-subtle">
<Trans i18nKey="signing_up_terms"> <Trans i18nKey="signing_up_terms" as="p">
By signing up, you agree to our{" "} By signing up, you agree to our
<Link className="text-emphasis hover:underline" href={`${WEBSITE_URL}/terms`}> <Link className="text-emphasis hover:underline" href={`${WEBSITE_URL}/terms`}>
Terms of Service Terms of Service
</Link>{" "} </Link>
and{" "}
<Link className="text-emphasis hover:underline" href={`${WEBSITE_URL}/privacy`}> <Link className="text-emphasis hover:underline" href={`${WEBSITE_URL}/privacy`}>
Privacy Policy Privacy Policy
</Link> </Link>
.
</Trans> </Trans>
</p> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -67,7 +67,7 @@
"cannot_repackage_codebase": "You can not repackage or sell the codebase", "cannot_repackage_codebase": "You can not repackage or sell the codebase",
"acquire_license": "Acquire a commercial license to remove these terms by emailing", "acquire_license": "Acquire a commercial license to remove these terms by emailing",
"terms_summary": "Summary of terms", "terms_summary": "Summary of terms",
"signing_up_terms":"By signing up, you agree to our <1>Terms of Service</1> and <2>Privacy Policy</2>.", "signing_up_terms":"By signing up, you agree to our <2>Terms of Service</2> and <4>Privacy Policy</4>.",
"open_env": "Open .env and agree to our License", "open_env": "Open .env and agree to our License",
"env_changed": "I've changed my .env", "env_changed": "I've changed my .env",
"accept_license": "Accept License", "accept_license": "Accept License",