• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / ae3aca99-180f-4804-ba95-dd591756eab2

28 May 2024 08:46PM CUT coverage: 84.423% (+0.009%) from 84.414%
ae3aca99-180f-4804-ba95-dd591756eab2

push

circleci

web-flow
Merge pull request #4726 from mozilla/dependabot/npm_and_yarn/stripe/stripe-js-3.4.1

Bump @stripe/stripe-js from 3.4.0 to 3.4.1

3619 of 4747 branches covered (76.24%)

Branch coverage included in aggregate %.

14813 of 17086 relevant lines covered (86.7%)

10.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frontend/src/components/landing/DemoPhone.tsx
1
import Image, { StaticImageData } from "next/image";
×
2
import styles from "./DemoPhone.module.scss";
×
3
import BgImage from "./images/hero-image-bg.svg";
×
4
import PremiumScreenshot from "./images/hero-image-premium.svg";
×
5
import PremiumScreenshotFr from "./images/hero-image-premium-fr.svg";
×
6
import PremiumScreenshotDe from "./images/hero-image-premium-de.svg";
×
7
import NoPremiumScreenshot from "./images/hero-image-nopremium.svg";
×
8
import FgImage from "./images/hero-image-fg.svg";
×
9
import FgImageDe from "./images/hero-image-fg-de.svg";
×
10
import FgImageFr from "./images/hero-image-fg-fr.svg";
×
11
import { getLocale } from "../../functions/getLocale";
×
12
import { useL10n } from "../../hooks/l10n";
×
13

14
export type Props = {
15
  premium?: boolean;
16
};
17

18
/**
19
 * Image of a phone showing the Relay interface, either the Premium or regular UI as desired.
20
 */
21

22
export const DemoPhone = (props: Props) => {
×
23
  const l10n = useL10n();
×
24
  const lang = getLocale(l10n).split("-")[0] ?? "en";
×
25

26
  const getScreenshotImage = (
×
27
    isPremium: boolean,
28
    lang: string,
29
  ): StaticImageData => {
30
    if (lang === "fr") {
×
31
      return PremiumScreenshotFr;
×
32
    }
33
    if (lang === "de") {
×
34
      return PremiumScreenshotDe;
×
35
    }
36
    // If Premium is not availabe in the country,
37
    // show no premium demo phone state
38
    if (!isPremium) {
×
39
      return NoPremiumScreenshot;
×
40
    }
41
    return PremiumScreenshot;
×
42
  };
43

44
  const getForegroundImage = (lang: string): StaticImageData => {
×
45
    if (lang === "fr") {
×
46
      return FgImageFr;
×
47
    }
48
    if (lang === "de") {
×
49
      return FgImageDe;
×
50
    }
51
    return FgImage;
×
52
  };
53

54
  return (
55
    <div className={styles.container}>
56
      <Image src={BgImage} alt="" className={styles.background} />
57

58
      <Image
59
        src={getScreenshotImage(props.premium ?? false, lang)}
×
60
        className={styles.phone}
61
        alt=""
62
      />
63
      <Image
64
        src={getForegroundImage(lang)}
65
        alt=""
66
        className={styles.foreground}
67
      />
68
    </div>
69
  );
70
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc