refactor: improve news and email handling, style, folder structure (#16)
This commit is contained in:
40
components/Footer.tsx
Normal file
40
components/Footer.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
'use client';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import CustomLink from './CustomLink';
|
||||
|
||||
const links = [{ name: 'Subscribe', path: '/' }];
|
||||
|
||||
export default function Footer() {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
<div>
|
||||
{pathname === '/' ? (
|
||||
<p className='text-center text-xs text-gray-600'>
|
||||
By subscribing, you agree to our{' '}
|
||||
<Link
|
||||
className='font-medium text-indigo-600 hover:text-indigo-500'
|
||||
href='/privacy'
|
||||
>
|
||||
Privacy Policy
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
) : (
|
||||
<div className='flex justify-center space-x-4'>
|
||||
{links.map(
|
||||
link =>
|
||||
pathname !== link.path &&
|
||||
!(pathname === '/confirmation' && link.path === '/') && (
|
||||
<CustomLink key={link.path} path={link.path} text={link.name} />
|
||||
)
|
||||
)}
|
||||
{pathname === '/privacy' && (
|
||||
<CustomLink path='/unsubscribe' text='Unsubscribe' />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user