Added footer with cookie notice (#3553)
* added footer * updated license headers * version++ * fixed eslint issues * Update cvat-ui/src/components/login-page/intel-footer-drawer.tsx Co-authored-by: Boris Sekachev <boris.sekachev@intel.com> * Update cvat-ui/src/components/login-page/intel-footer-drawer.tsx Co-authored-by: Boris Sekachev <boris.sekachev@intel.com> * Update cvat-ui/src/components/login-page/intel-footer-drawer.tsx Co-authored-by: Boris Sekachev <boris.sekachev@intel.com> * fixed comments * minor fix * fixed linter Co-authored-by: Boris Sekachev <boris.sekachev@intel.com>main
parent
1da3c96b5a
commit
987b2efd5a
@ -1,49 +0,0 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Drawer from 'antd/lib/drawer';
|
||||
import Paragraph from 'antd/lib/typography/Paragraph';
|
||||
import Button from 'antd/lib/button/button';
|
||||
|
||||
import { isPublic } from 'utils/enviroment';
|
||||
|
||||
function CookieDrawer(): JSX.Element {
|
||||
const [drawerVisible, setDrawerVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const cookiePolicyAccepted = localStorage.getItem('cookiePolicyAccepted');
|
||||
if (cookiePolicyAccepted === null && isPublic()) {
|
||||
setDrawerVisible(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const onClose = (): void => {
|
||||
localStorage.setItem('cookiePolicyAccepted', 'true');
|
||||
setDrawerVisible(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
title='About Cookies on this site:'
|
||||
placement='bottom'
|
||||
closable={false}
|
||||
visible={drawerVisible}
|
||||
height={200}
|
||||
destroyOnClose
|
||||
>
|
||||
<Paragraph>
|
||||
This site uses cookies for functionality, analytics, and advertising purposes as described in our Cookie
|
||||
and Similar Technologies Notice. To see what cookies we serve and set your preferences, please visit our
|
||||
<a href='https://www.intel.com/cookies'> Cookie Consent Tool</a>. By continuing to use our website, you
|
||||
agree to our use of cookies.
|
||||
</Paragraph>
|
||||
<Button onClick={onClose} size='large' type='primary'>
|
||||
Accept
|
||||
</Button>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
export default CookieDrawer;
|
||||
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2021 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import React from 'react';
|
||||
import { Layout } from 'antd';
|
||||
|
||||
import { isPublic } from 'utils/enviroment';
|
||||
import consts from 'consts';
|
||||
|
||||
function FooterDrawer(): JSX.Element | null {
|
||||
const { Footer } = Layout;
|
||||
const { INTEL_TERMS_OF_USE_URL, INTEL_COOKIES_URL, INTEL_PRIVACY_URL } = consts;
|
||||
|
||||
return isPublic() ? (
|
||||
<Footer style={{ textAlign: 'center', borderTop: '1px solid #e8e8e8' }}>
|
||||
© Intel Corporation |
|
||||
<a target='_blank' rel='noopener noreferrer' href={INTEL_TERMS_OF_USE_URL}> Terms of Use </a>
|
||||
|
|
||||
<a target='_blank' rel='noopener noreferrer' data-cookie-notice='true' href={INTEL_COOKIES_URL}> Cookies </a>
|
||||
|
|
||||
<a target='_blank' rel='noopener noreferrer' href={INTEL_PRIVACY_URL}> Privacy </a>
|
||||
</Footer>
|
||||
) : null;
|
||||
}
|
||||
|
||||
export default React.memo(FooterDrawer);
|
||||
Loading…
Reference in New Issue