diff --git a/app/scripts/components/common/cookie-consent/index.tsx b/app/scripts/components/common/cookie-consent/index.tsx index 1b0606491..fe40b4748 100644 --- a/app/scripts/components/common/cookie-consent/index.tsx +++ b/app/scripts/components/common/cookie-consent/index.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { debounce } from 'lodash'; import { Icon } from '@trussworks/react-uswds'; - +import { css } from '@emotion/react'; import { setCookie, getCookie } from './utils'; import { USWDSAlert, @@ -10,11 +10,40 @@ import { } from '$components/common/uswds'; import './index.scss'; - +interface cookieConsentTheme { + card?: { + backgroundColor?: string; + sideBarColor?: string; + textColor?: string; + linkColor?: string; + }; + acceptButton?: { + default?: { + backgroundColor?: string; + textColor?: string; + }; + hover?: { + backgroundColor?: string; + textColor?: string; + }; + }; + declineButton?: { + default?: { + borderColor?: string; + textColor?: string; + }; + hover?: { + borderColor?: string; + textColor?: string; + }; + }; + iconColor?: { default?: string; hover?: string }; +} interface CookieConsentProps { title?: string | undefined; copy?: string | undefined; pathname: string; + theme?: cookieConsentTheme; setDisplayCookieConsentForm: (boolean) => void; setGoogleTagManager: () => void; } @@ -27,6 +56,7 @@ export const CookieConsent = ({ title, copy, pathname, + theme, setDisplayCookieConsentForm, setGoogleTagManager }: CookieConsentProps) => { @@ -90,6 +120,12 @@ export const CookieConsent = ({ setGoogleTagManager ]); + const transitionSettings = ` -webkit-transition: all 0.24s ease 0s; transition: all 0.24s ease 0s;`; + + const themeValueCheck = (themeItem) => { + //checking for null, undefined or empty string values + return themeItem !== undefined || themeItem !== '' ? true : false; + }; return (