瀏覽代碼

Remove unused code

Came across this when trying to migrate off bootstrap in the few remaining
places, this code is unused and just removing it instead of doing a migration of
it to mui.
Manav Rathi 1 年之前
父節點
當前提交
e84b989484

+ 0 - 20
web/apps/photos/src/components/pages/sharedAlbum/ReportAbuse.tsx

@@ -1,20 +0,0 @@
-import { styled } from "@mui/material";
-import { Button } from "react-bootstrap";
-const Container = styled("div")`
-    position: fixed;
-    bottom: 7%;
-    right: 2%;
-    align-self: flex-end;
-`;
-
-interface Iprops {
-    onClick: () => void;
-}
-
-export default function ReportAbuse(props: Iprops) {
-    return (
-        <Container>
-            <Button onClick={props.onClick}>report abuse?</Button>
-        </Container>
-    );
-}

+ 0 - 4
web/apps/photos/src/constants/publicCollection.ts

@@ -1,4 +0,0 @@
-export enum REPORT_REASON {
-    COPYRIGHT = "COPYRIGHT",
-    MALICIOUS_CONTENT = "MALICIOUS_CONTENT",
-}

+ 1 - 30
web/apps/photos/src/services/publicCollectionService.ts

@@ -4,14 +4,9 @@ import HTTPService from "@ente/shared/network/HTTPService";
 import { getEndpoint } from "@ente/shared/network/api";
 import { logError } from "@ente/shared/sentry";
 import localForage from "@ente/shared/storage/localForage";
-import { REPORT_REASON } from "constants/publicCollection";
 import { Collection, CollectionPublicMagicMetadata } from "types/collection";
 import { EncryptedEnteFile, EnteFile } from "types/file";
-import {
-    AbuseReportDetails,
-    AbuseReportRequest,
-    LocalSavedPublicCollectionFiles,
-} from "types/publicCollection";
+import { LocalSavedPublicCollectionFiles } from "types/publicCollection";
 import { decryptFile, mergeMetadata, sortFiles } from "utils/file";
 
 const ENDPOINT = getEndpoint();
@@ -376,30 +371,6 @@ export const verifyPublicCollectionPassword = async (
     }
 };
 
-export const reportAbuse = async (
-    token: string,
-    url: string,
-    reason: REPORT_REASON,
-    details: AbuseReportDetails,
-) => {
-    try {
-        if (!token) {
-            return;
-        }
-        const abuseReportRequest: AbuseReportRequest = { url, reason, details };
-
-        await HTTPService.post(
-            `${ENDPOINT}/public-collection/report-abuse`,
-            abuseReportRequest,
-            null,
-            { "X-Auth-Access-Token": token },
-        );
-    } catch (e) {
-        logError(e, "failed to post abuse report");
-        throw e;
-    }
-};
-
 export const removePublicCollectionWithFiles = async (
     collectionUID: string,
     collectionKey: string,

+ 0 - 26
web/apps/photos/src/types/publicCollection/index.ts

@@ -1,5 +1,4 @@
 import { TimeStampListItem } from "components/PhotoList";
-import { REPORT_REASON } from "constants/publicCollection";
 import { PublicURL } from "types/collection";
 import { EnteFile } from "types/file";
 
@@ -17,31 +16,6 @@ export interface LocalSavedPublicCollectionFiles {
     files: EnteFile[];
 }
 
-export interface AbuseReportRequest {
-    url: string;
-    reason: REPORT_REASON;
-    details: AbuseReportDetails;
-}
-
-export interface AbuseReportDetails {
-    fullName: string;
-    email: string;
-    comment: string;
-    signature: string;
-    onBehalfOf: string;
-    jobTitle: string;
-    address: Address;
-}
-
-export interface Address {
-    street: string;
-    city: string;
-    state: string;
-    country: string;
-    postalCode: string;
-    phone: string;
-}
-
 export type SetPublicShareProp = React.Dispatch<
     React.SetStateAction<PublicURL>
 >;