Skip to content

Commit

Permalink
adds upcoming changes banner to homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Jan 12, 2024
1 parent 7e9e620 commit 30fa26e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
44 changes: 44 additions & 0 deletions app/layout/upcoming-changes/component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { useCallback } from 'react';

import { useCookies } from 'react-cookie';

import { useFeatureFlags } from 'hooks/feature-flags';

import Button from 'components/button';
import Wrapper from 'layout/wrapper';

export const UpcomingChangesBanner = (): JSX.Element => {
const [cookies, setCookie] = useCookies(['upcoming-changes']);
const { upcomingChanges } = useFeatureFlags();

const onAccept = useCallback(() => {
setCookie('upcoming-changes', 'true', { path: '/' });
}, [setCookie]);

if (cookies['upcoming-changes'] === 'true' || !upcomingChanges) return null;

return (
<div className="relative z-10 w-full bg-yellow-600">
<Wrapper>
<div className="flex items-center space-x-5 py-2 text-sm text-gray-800">
<p>
MaPP is undergoing a transformation with an enhanced interface and new features released
by the <span className="font-bold">end of January 2024</span>! Your existing projects
will seamlessly transition to the new version. For any concerns, feel free to reach out
to us. Stay tuned for a better planning experience!
</p>
<Button
theme="secondary"
size="s"
className="flex-shrink-0 whitespace-nowrap"
onClick={onAccept}
>
Accept
</Button>
</div>
</Wrapper>
</div>
);
};

export default UpcomingChangesBanner;
1 change: 1 addition & 0 deletions app/layout/upcoming-changes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './component';
3 changes: 3 additions & 0 deletions app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import PartnersList from 'layout/home/partners';
import Support from 'layout/home/support';
import MetaIcons from 'layout/meta-icons';
import MetaTags from 'layout/meta-tags';
import UpcomingChanges from 'layout/upcoming-changes';

export const getServerSideProps = withUser();

Expand All @@ -26,6 +27,8 @@ const Home = (): JSX.Element => {

<MetaIcons />

<UpcomingChanges />

<MetaTags
name="Marxan conservation Solutions"
title="Spatial conservation planning in the cloud"
Expand Down

0 comments on commit 30fa26e

Please sign in to comment.