Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating cookie consent component #1127

Merged
merged 40 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8c62b28
creating cookie consent component POC
snmln Aug 26, 2024
35f324f
cleaning up padding
snmln Aug 27, 2024
b57b33c
adjusting max width for poc
snmln Aug 27, 2024
0e73df9
creating modal exit animation
snmln Aug 29, 2024
6a49da2
removing cookieconsent component
snmln Aug 29, 2024
eb03d75
adding necessary uswds scss pacakagse
snmln Aug 30, 2024
e74f01a
creating core functionality
snmln Aug 30, 2024
6d6695e
creating mobile styling
snmln Aug 30, 2024
4714652
Merge branch 'main' into Cookie-consent-form-POC
snmln Sep 3, 2024
a1057a2
creating cookie consent component POC
snmln Aug 26, 2024
e150e29
implementing dynamic link positioning
snmln Sep 3, 2024
82ce544
cleaning up layoutroot
snmln Sep 3, 2024
16374be
reverting cookie consent format.
snmln Sep 3, 2024
1a6ad88
creating unit test
snmln Sep 4, 2024
322ab1c
correcting Chrome bug
snmln Sep 4, 2024
b77d334
cleaning out comments
snmln Sep 4, 2024
d4bd88d
registering cookieconsent content with parcel
snmln Sep 4, 2024
746f697
adding ENV flag for cookie usage
snmln Sep 4, 2024
019ee97
adding null check
snmln Sep 5, 2024
33fb687
adding CookieConsentFromVedaConfig
snmln Sep 5, 2024
1adb24a
addressing test and lint errors
snmln Sep 5, 2024
e3b6966
Merge branch 'main' into Cookie-consent-form-POC
snmln Sep 11, 2024
b3b238f
Implementing review feedback
snmln Sep 13, 2024
50029a2
adding components to USWDS and creating roll up file.
snmln Sep 16, 2024
99170d7
implementing review feedback
snmln Sep 17, 2024
b7267e2
addressing lint and ts-check issues
snmln Sep 17, 2024
a030126
implementing util classes
snmln Sep 18, 2024
11ee198
removing uneccessary comments
snmln Sep 18, 2024
9cc346e
removing redundant util file
snmln Sep 18, 2024
01b7443
remving .env check
snmln Sep 18, 2024
84d3d62
Parse cookie consent form as html
hanbyul-here Sep 20, 2024
51d6270
Parse cookie consent form as html (#1163)
hanbyul-here Sep 20, 2024
80f63a9
implementing Parcel resolver and cleaning up test
snmln Sep 23, 2024
4ff71e5
Remove custom styles, other small touch-ups, hide the cookie consent
hanbyul-here Sep 23, 2024
ce5415e
Touch up for animation, separate constants
hanbyul-here Sep 23, 2024
5b981fc
Merge branch 'Cookie-consent-form-POC' into cookie-consent-touch-up
snmln Sep 23, 2024
107ce35
correcting lint errors
snmln Sep 23, 2024
9b14371
Remove custom styles, other small touch-ups, hide the cookie consent …
snmln Sep 23, 2024
9356b87
Fix Cookey Key
hanbyul-here Sep 25, 2024
3bbd537
Fix test
hanbyul-here Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/scripts/components/common/cookie-consent/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.modal {
hanbyul-here marked this conversation as resolved.
Show resolved Hide resolved
z-index: 999;
position: fixed;
max-width: 725px;
border-radius: 35px;
snmln marked this conversation as resolved.
Show resolved Hide resolved
bottom: 0;
right: 0;
}
31 changes: 31 additions & 0 deletions app/scripts/components/common/cookie-consent/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Alert, Button, ButtonGroup, Link } from '@trussworks/react-uswds';
import React from 'react';
import './index.scss';
export const CookieConsent = () => {
return (
<div className='modal margin-2'>
<Alert
type='info'
heading='Cookie Consent'
headingLevel='h1'
noIcon={true}
>
<div className='padding-bottom-2'>
We use cookies to enhance your browsing experience and to help us
understand how our website is used. These cookies allow us to collect
data on site usage and improve our services based on your
interactions. To learn more about it, see our{' '}
<Link href='https://www.nasa.gov/privacy/#cookies'>
Privacy Policy
</Link>
</div>
<ButtonGroup>
<Button outline={true} type={'button'}>
Decline Cookies
</Button>
<Button type={'button'}>Accept Cookies</Button>
</ButtonGroup>
</Alert>
</div>
);
};
19 changes: 11 additions & 8 deletions app/scripts/components/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
ContentOverride
} from '$components/common/page-overrides';

import { CookieConsent } from '$components/common/cookie-consent';

const homeContent = getOverride('homeContent');

const Connections = styled(Hug)`
Expand Down Expand Up @@ -112,10 +114,10 @@ const getCoverProps = () => {

return author
? {
...coverProps,
attributionAuthor: author.name,
attributionUrl: author.url
}
...coverProps,
attributionAuthor: author.name,
attributionUrl: author.url
}
: coverProps;
} else {
return {
Expand All @@ -136,11 +138,11 @@ function RootHome() {

return (
<PageMainContent>
<LayoutProps
title='Welcome'
banner={renderBanner? {...banner}: null}
<LayoutProps
title='Welcome'
banner={renderBanner ? { ...banner } : null}
/>

<CookieConsent/>
<ComponentOverride with='homeHero'>
<PageHeroHome
title={homeContent?.data.title ?? `Welcome to the ${appTitle}`}
Expand Down Expand Up @@ -171,6 +173,7 @@ function RootHome() {
</ComponentOverride>

<ContentOverride with='homeContent'>

<Audience />

<FeaturedStories />
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
@use "usa-banner";
@use "usa-button";
@use "usa-card";
@use "usa-alert";
@use "usa-button-group";