This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update lint commands and eslint ignore * Run lints and refactor privacy cards * Refactor modal * Finish verification flow * get config from server * Update changelong * Fix test failures * Format file * Mock out route * Format file * Add code resending * Update test to use hostUrl * Add headers util function and PrivacyRequestStatus status enum
- Loading branch information
1 parent
d0078fa
commit 12de691
Showing
17 changed files
with
905 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
.eslintrc.json | ||
next.config.js | ||
jest.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
|
||
/** | ||
* Adds common headers to all api calls to fidesops | ||
*/ | ||
export function addCommonHeaders(headers: Headers, token: string | null) { | ||
headers.set("Access-Control-Allow-Origin", "*"); | ||
headers.set("X-Fides-Source", "fidesops-privacy-center"); | ||
headers.set("Accept", "application/json"); | ||
headers.set("Content-Type", "application/json"); | ||
if (token) { | ||
headers.set("authorization", `Bearer ${token}`); | ||
} | ||
return headers; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from "react"; | ||
import { Heading, Text, Stack, Box, Image, HStack } from "@fidesui/react"; | ||
|
||
type PrivacyCardProps = { | ||
title: string; | ||
policyKey: string; | ||
iconPath: string; | ||
description: string; | ||
onOpen: (policyKey: string) => void; | ||
}; | ||
|
||
const PrivacyCard: React.FC<PrivacyCardProps> = ({ | ||
title, | ||
policyKey, | ||
iconPath, | ||
description, | ||
onOpen, | ||
}) => ( | ||
<Box | ||
as="button" | ||
key={title} | ||
bg="white" | ||
py={8} | ||
px={6} | ||
borderRadius={4} | ||
boxShadow="base" | ||
maxWidth={["100%", "100%", "100%", 304]} | ||
transition="box-shadow 50ms" | ||
cursor="pointer" | ||
userSelect="none" | ||
m={2} | ||
_hover={{ | ||
boxShadow: "complimentary-2xl", | ||
}} | ||
_focus={{ | ||
outline: "none", | ||
boxShadow: "complimentary-2xl", | ||
}} | ||
onClick={() => onOpen(policyKey)} | ||
> | ||
<Stack spacing={7}> | ||
<HStack justifyContent="center"> | ||
<Image src={iconPath} alt={description} width="54px" height="54px" /> | ||
</HStack> | ||
|
||
<Stack spacing={1} textAlign="center"> | ||
<Heading | ||
fontSize="large" | ||
fontWeight="semibold" | ||
lineHeight="28px" | ||
color="gray.600" | ||
> | ||
{title} | ||
</Heading> | ||
<Text fontSize="xs" color="gray.600"> | ||
{description} | ||
</Text> | ||
</Stack> | ||
</Stack> | ||
</Box> | ||
); | ||
|
||
export default PrivacyCard; |
Oops, something went wrong.