Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update landing page experiment email input #5592

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/(proper_react)/(redesign)/(public)/FreeScanCta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { useViewTelemetry } from "../../../hooks/useViewTelemetry";
export const FreeScanCta = (
props: Props & {
experimentData: ExperimentData["Features"];
hasFloatingLabel?: boolean;
showCtaOnly?: boolean;
},
) => {
Expand Down Expand Up @@ -53,7 +52,7 @@ export const FreeScanCta = (
placeholder={props.placeholder}
label={props.label}
ctaLabel={props.ctaLabel}
hasFloatingLabel={props.hasFloatingLabel}
labelPosition={props.labelPosition}
/>
);
}
Expand Down
7 changes: 6 additions & 1 deletion src/app/(proper_react)/(redesign)/(public)/LandingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const View = (props: Props) => {
field: "entered_email_address_header",
}}
experimentData={props.experimentData}
labelPosition="bottom"
/>
)}
</div>
Expand Down Expand Up @@ -144,6 +145,7 @@ export const View = (props: Props) => {
field: "entered_email_address_second",
}}
experimentData={props.experimentData}
labelPosition="bottom"
/>
</span>
<div className={styles.illustration}>
Expand Down Expand Up @@ -191,6 +193,7 @@ export const View = (props: Props) => {
field: "entered_email_address_third",
}}
experimentData={props.experimentData}
labelPosition="bottom"
/>
</span>
<div className={styles.illustration}>
Expand All @@ -212,6 +215,7 @@ export const View = (props: Props) => {
}}
scanLimitReached={props.scanLimitReached}
experimentData={props.experimentData}
labelPosition="bottom"
/>
</div>

Expand Down Expand Up @@ -256,6 +260,7 @@ export const View = (props: Props) => {
}}
scanLimitReached={props.scanLimitReached}
experimentData={props.experimentData}
labelPosition="bottom"
/>
</div>
</main>
Expand Down Expand Up @@ -324,10 +329,10 @@ const Plans = (props: Props) => {
}}
scanLimitReached={props.scanLimitReached}
experimentData={props.experimentData}
labelPosition="bottom"
/>
</div>
)}

<PlansTable
aria-labelledby={headingId}
premiumSubscriptionUrl={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

@media screen and (min-width: tokens.$screen-md) {
form {
align-items: flex-end;
flex-direction: row;
button {
flex: 0 0 auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const CtaInputBanner = (props: LandingPageProps) => {
ctaLabel={props.l10n.getString(
"landing-redesign-hero-cta-button-label",
)}
hasFloatingLabel
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,18 @@
display: flex;
flex-direction: column;
gap: tokens.$spacing-md;

label {
color: tokens.$color-purple-05;
}
}

@media screen and (min-width: tokens.$screen-md) {
max-width: tokens.$content-md;
padding: 0 tokens.$layout-md;

form {
align-items: flex-end;
flex-direction: row;
button {
flex: 0 0 auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const Hero = (props: LandingPageProps) => {
ctaLabel={props.l10n.getString(
"landing-redesign-hero-cta-button-label",
)}
hasFloatingLabel
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const InfoBlock = (props: LandingPageProps) => {
<ArrowIcon alt="" />
</>
}
hasFloatingLabel
showCtaOnly
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
div:first-child {
display: flex;
flex: 1;
flex-direction: column-reverse;
flex-direction: column;
}

&.bottom {
div:first-child {
flex-direction: column-reverse;
}
}

input {
Expand Down
5 changes: 3 additions & 2 deletions src/app/(proper_react)/(redesign)/(public)/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type Props = {
placeholder?: string;
ctaLabel?: string | ReactNode;
hasFloatingLabel?: boolean;
labelPosition?: "top" | "bottom" | "floating";
};

export const SignUpForm = (props: Props) => {
Expand Down Expand Up @@ -79,7 +80,7 @@ export const SignUpForm = (props: Props) => {
) : (
<form
ref={refViewTelemetry as RefObject<HTMLFormElement | null>}
className={styles.form}
className={`${styles.form} ${props.labelPosition ? styles[props.labelPosition] : ""}`}
onSubmit={onSubmit}
>
<InputField
Expand All @@ -99,7 +100,7 @@ export const SignUpForm = (props: Props) => {
field_id: props.eventId.field,
});
}}
hasFloatingLabel={props.hasFloatingLabel}
hasFloatingLabel={props.labelPosition === "floating"}
/>
<Button
type="submit"
Expand Down
9 changes: 5 additions & 4 deletions src/app/components/client/InputField.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

.inputField {
background: tokens.$color-white;
border: 1px solid tokens.$color-grey-30;
border: none;
box-shadow: inset 0 0 0 1px tokens.$color-grey-30;
border-radius: tokens.$border-radius-md;
color: tokens.$color-black;
// Add a bit more space: The next spacing step is too much.
Expand All @@ -54,19 +55,19 @@
border-color: tokens.$color-error;

&:focus {
border: 1px solid tokens.$color-error;
box-shadow: inset 0 0 0 1px tokens.$color-error;
outline: tokens.$border-focus-width solid tokens.$color-error-focus;
}
}

&:focus {
border: 1px solid tokens.$color-purple-70;
box-shadow: inset 0 0 0 1px tokens.$color-purple-70;
outline: tokens.$border-focus-width solid tokens.$color-purple-40;
}

&:disabled {
background: none;
border: 1px solid tokens.$color-grey-10;
box-shadow: inset 0 0 0 1px tokens.$color-grey-10;
}
}

Expand Down
Loading