Skip to content

Commit

Permalink
fixed bug for yearlySubscriptionUrl import
Browse files Browse the repository at this point in the history
  • Loading branch information
James Espy authored and James Espy committed Jun 5, 2024
1 parent 3d829b6 commit a8f6ca9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ import { FooterSection } from "./components/FooterSection";

export type Props = {
l10n: ExtendedReactLocalization;
yearlySubscriptionUrl?: string;
};

export const HowItWorksView = () => {
export const HowItWorksView = ({
yearlySubscriptionUrl,
}: {
yearlySubscriptionUrl: string;
}) => {
const l10n = useL10n();
return (
<main>
<Header l10n={l10n} />
<DataBrokers l10n={l10n} />
<DataBrokers l10n={l10n} yearlySubscriptionUrl={yearlySubscriptionUrl} />
<DataBreaches l10n={l10n} />
<FooterSection l10n={l10n} />
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import {
} from "../images";
import styles from "../HowItWorksView.module.scss";
import { TelemetryButton } from "../../../../../components/client/TelemetryButton";
import { getPremiumSubscriptionUrl } from "../../../../../functions/server/getPremiumSubscriptionInfo";

export const DataBrokers = (props: Props) => {
const { l10n } = props;
const yearlySubscriptionUrl = getPremiumSubscriptionUrl({ type: "yearly" });
const { l10n, yearlySubscriptionUrl } = props;

return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import { headers } from "next/headers";
import { HowItWorksView } from "./HowItWorksView";
import { getCountryCode } from "../../../../functions/server/getCountryCode";
import { redirect } from "next/navigation";
import { getPremiumSubscriptionUrl } from "../../../../functions/server/getPremiumSubscriptionInfo";

export default function Page() {
const headersList = headers();
const countryCode = getCountryCode(headersList);
const yearlySubscriptionUrl = getPremiumSubscriptionUrl({ type: "yearly" });

if (countryCode !== "us") {
return redirect("/");
}

return <HowItWorksView />;
return <HowItWorksView yearlySubscriptionUrl={yearlySubscriptionUrl} />;
}

0 comments on commit a8f6ca9

Please sign in to comment.