Skip to content

Commit

Permalink
remove changes to dashboard.js
Browse files Browse the repository at this point in the history
  • Loading branch information
codemist committed Jul 27, 2023
1 parent bbd59bf commit 8669e27
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export const DashboardTopBanner = (props: DashboardTopBannerProps) => {
}
);

const breachChartData: [string, number][] =
props.bannerData.sanitizedBreachExposures.map((obj) => {
const [key, value] = Object.entries(obj)[0];
return [l10n.getString(key), value];
});

const contentData = {
LetsFixDataContent: {
headline: l10n.getString("dashboard-top-banner-protect-your-data-title"),
Expand Down Expand Up @@ -130,6 +124,7 @@ export const DashboardTopBanner = (props: DashboardTopBannerProps) => {
};

const content = contentData[props.type];
console.log(props.hasRunScan);

return (
<div className={styles.container}>
Expand All @@ -147,7 +142,7 @@ export const DashboardTopBanner = (props: DashboardTopBannerProps) => {
)}
</div>
<div className={styles.chart}>
<Chart data={props.hasRunScan ? chartData : breachChartData} />
<Chart hasRunScan={props.hasRunScan} data={chartData} />
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export const View = (props: Props) => {
? "DataBrokerScanUpsellContent"
: "LetsFixDataContent"
}
hasRunScan={!isScanResultItemsEmpty}
/>
<section className={styles.exposuresArea}>
<h2 className={styles.exposuresAreaHeadline}>
Expand Down
21 changes: 11 additions & 10 deletions src/app/components/client/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Link from "next/link";

export type Props = {
data: Array<[string, number]>;
hasRunScan: boolean;
};

export const DoughnutChart = (props: Props) => {
Expand Down Expand Up @@ -96,6 +97,15 @@ export const DoughnutChart = (props: Props) => {
</div>
);

const prompt = (
<div className={styles.prompt}>
<p>{l10n.getString("exposure-chart-returning-user-upgrade-prompt")}</p>
<Link href="/redesign/user/welcome">
{l10n.getString("exposure-chart-returning-user-upgrade-prompt-cta")}
</Link>
</div>
);

return (
<>
<figure className={styles.chartContainer}>
Expand Down Expand Up @@ -178,16 +188,7 @@ export const DoughnutChart = (props: Props) => {
))}
</tbody>
</table>
<div className={styles.prompt}>
<p>
{l10n.getString("exposure-chart-returning-user-upgrade-prompt")}
</p>
<Link href="/redesign/user/welcome">
{l10n.getString(
"exposure-chart-returning-user-upgrade-prompt-cta"
)}
</Link>
</div>
{!props.hasRunScan ? prompt : null}
</div>
</div>
<figcaption>
Expand Down

0 comments on commit 8669e27

Please sign in to comment.