Skip to content

Commit d6be9dc

Browse files
committed
remove data broker from dashboard
1 parent 22e6364 commit d6be9dc

File tree

2 files changed

+4
-27
lines changed
  • src/app
    • (proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard
    • components/client/exposure_card

2 files changed

+4
-27
lines changed

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/View.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { useL10n } from "../../../../../../hooks/l10n";
2020
import {
2121
Exposure,
2222
ExposureCard,
23-
isScanResult,
2423
} from "../../../../../../components/client/exposure_card/ExposureCard";
2524
import {
2625
ExposuresFilter,
@@ -214,16 +213,12 @@ export const View = (props: Props) => {
214213
if (exposureCardKey === activeExposureCardKey) {
215214
setActiveExposureCardKey(null);
216215
recordTelemetry("collapse", "click", {
217-
button_id: isScanResult(exposure)
218-
? `data_broker_card_${exposure.id}`
219-
: `data_breach_card_${exposure.id}`,
216+
button_id: `data_breach_card_${exposure.id}`,
220217
});
221218
} else {
222219
setActiveExposureCardKey(exposureCardKey);
223220
recordTelemetry("expand", "click", {
224-
button_id: isScanResult(exposure)
225-
? `data_broker_card_${exposure.id}`
226-
: `data_breach_card_${exposure.id}`,
221+
button_id: `data_breach_card_${exposure.id}`,
227222
});
228223
}
229224
}}

src/app/components/client/exposure_card/ExposureCard.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,15 @@
55
"use client";
66

77
import React, { ReactNode } from "react";
8-
import {
9-
OnerepScanResultDataBrokerRow,
10-
OnerepScanResultRow,
11-
} from "knex/types/tables";
128
import { StaticImageData } from "next/image";
139
import { SubscriberBreach } from "../../../../utils/subscriberBreaches";
14-
import { ScanResultCard } from "./ScanResultCard";
1510
import { SubscriberBreachCard } from "./SubscriberBreachCard";
1611
import { FeatureFlagName } from "../../../../db/tables/featureFlags";
1712
import { ExperimentData } from "../../../../telemetry/generated/nimbus/experiments";
1813

19-
export type Exposure = OnerepScanResultDataBrokerRow | SubscriberBreach;
20-
21-
// Typeguard function
22-
export function isScanResult(
23-
obj: Exposure,
24-
): obj is OnerepScanResultDataBrokerRow {
25-
return (obj as OnerepScanResultRow).data_broker !== undefined;
26-
}
27-
2814
export type ExposureCardProps = {
2915
exposureImg?: StaticImageData;
30-
exposureData: Exposure;
16+
exposureData: SubscriberBreach;
3117
locale: string;
3218
isPremiumUser: boolean;
3319
isEligibleForPremium: boolean;
@@ -41,9 +27,5 @@ export type ExposureCardProps = {
4127
};
4228

4329
export const ExposureCard = ({ exposureData, ...props }: ExposureCardProps) => {
44-
return isScanResult(exposureData) ? (
45-
<ScanResultCard {...props} scanResult={exposureData} />
46-
) : (
47-
<SubscriberBreachCard {...props} subscriberBreach={exposureData} />
48-
);
30+
return <SubscriberBreachCard {...props} subscriberBreach={exposureData} />;
4931
};

0 commit comments

Comments
 (0)