From 25ad73aa9dcb78552eb07e186011ae315919ed2c Mon Sep 17 00:00:00 2001 From: Ardeman Date: Sun, 2 Feb 2025 03:15:18 +0800 Subject: [PATCH] feat: add social media icons to footer menu and update layout --- app/components/icons/facebook.tsx | 19 ++++ app/components/icons/instagram.tsx | 19 ++++ app/components/icons/linkedin.tsx | 19 ++++ app/components/icons/x.tsx | 19 ++++ app/data/menu.ts | 124 +++++++++++++++++++++++++-- app/pages/news/footer-links.tsx | 54 +++++++++++- app/pages/news/footer-newsletter.tsx | 2 +- app/pages/news/index.tsx | 2 +- 8 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 app/components/icons/facebook.tsx create mode 100644 app/components/icons/instagram.tsx create mode 100644 app/components/icons/linkedin.tsx create mode 100644 app/components/icons/x.tsx diff --git a/app/components/icons/facebook.tsx b/app/components/icons/facebook.tsx new file mode 100644 index 0000000..e354032 --- /dev/null +++ b/app/components/icons/facebook.tsx @@ -0,0 +1,19 @@ +import type { JSX, SVGProps } from 'react' + +export const FacebookIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/icons/instagram.tsx b/app/components/icons/instagram.tsx new file mode 100644 index 0000000..231bb57 --- /dev/null +++ b/app/components/icons/instagram.tsx @@ -0,0 +1,19 @@ +import type { JSX, SVGProps } from 'react' + +export const InstagramIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/icons/linkedin.tsx b/app/components/icons/linkedin.tsx new file mode 100644 index 0000000..c1e94e1 --- /dev/null +++ b/app/components/icons/linkedin.tsx @@ -0,0 +1,19 @@ +import type { JSX, SVGProps } from 'react' + +export const LinkedinIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/icons/x.tsx b/app/components/icons/x.tsx new file mode 100644 index 0000000..f3daaf5 --- /dev/null +++ b/app/components/icons/x.tsx @@ -0,0 +1,19 @@ +import type { JSX, SVGProps } from 'react' + +export const XIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/data/menu.ts b/app/data/menu.ts index b01e3c5..ba008f3 100644 --- a/app/data/menu.ts +++ b/app/data/menu.ts @@ -1,30 +1,140 @@ +import type { JSX } from 'react' + +import { FacebookIcon } from '~/components/icons/facebook' +import { InstagramIcon } from '~/components/icons/instagram' +import { LinkedinIcon } from '~/components/icons/linkedin' +import { XIcon } from '~/components/icons/x' + export const MENU = [ { title: 'Spotlight', - url: '/topic?category=spotlight', + url: '/news/topic?category=spotlight', }, { title: 'Berita', - url: '/topic?category=berita', + url: '/news/topic?category=berita', }, { title: 'Kasus', - url: '/topic?category=kasus', + url: '/news/topic?category=kasus', }, { title: 'Kajian', - url: '/topic?category=kajian', + url: '/news/topic?category=kajian', }, { title: 'Lifestyle', - url: '/topic?category=lifestyle', + url: '/news/topic?category=lifestyle', }, { title: 'Event', - url: '/topic?category=event', + url: '/news/topic?category=event', }, { title: 'Travel', - url: '/topic?category=travel', + url: '/news/topic?category=travel', + }, +] + +type FooterMenu = { + group: string + items: Array<{ + title: string + url: string + icon?: ( + properties: JSX.IntrinsicAttributes & React.SVGProps, + ) => JSX.Element + }> +} +export const FOOTER_MENU: FooterMenu[] = [ + { + group: 'About Us', + items: [ + { + title: 'Popular', + url: '/news/list?sort=popular', + }, + { + title: 'Trending', + url: '/news/list?sort=trending', + }, + { + title: 'Contact', + url: '/news/contact', + }, + { + title: 'Support/Help', + url: '/news/support', + }, + { + title: 'Rquest Topic', + url: '/news/request-topic', + }, + ], + }, + { + group: 'Column Two', + items: [ + { + title: 'FAQs', + url: '/news/faq', + }, + { + title: 'Terms and Condition', + url: '/news/terms-condition', + }, + { + title: 'Support', + url: '/news/support', + }, + { + title: 'Link Nine', + url: '/news', + }, + { + title: 'Link Ten', + url: '/news', + }, + ], + }, + { + group: 'Follow Us', + items: [ + { + title: 'Facebook', + icon: FacebookIcon, + url: 'https://facebook.com', + }, + { + title: 'Instagram', + icon: InstagramIcon, + url: 'https://instagram.com', + }, + { + title: 'X', + icon: XIcon, + url: 'https://x.com', + }, + { + title: 'Linkedin', + icon: LinkedinIcon, + url: 'https://linkedin.com', + }, + ], + }, +] + +export const COPYRIGHT_MENU = [ + { + title: 'Privacy Policy', + url: '/news/privacy-policy', + }, + { + title: 'Terms of Service', + url: '/news/terms-of-service', + }, + { + title: 'Cookies Settings', + url: '/news/cookies-settings', }, ] diff --git a/app/pages/news/footer-links.tsx b/app/pages/news/footer-links.tsx index 5b9ecfc..30dff67 100644 --- a/app/pages/news/footer-links.tsx +++ b/app/pages/news/footer-links.tsx @@ -1,3 +1,55 @@ +import { Link } from 'react-router' + +import { DUMMY } from '~/data/dummy' +import { COPYRIGHT_MENU, FOOTER_MENU } from '~/data/menu' + export const FooterLinks = () => { - return
FooterLinks
+ return ( +
+
+ {FOOTER_MENU.map(({ group, items }, index) => ( +
+

{group}

+
+ {items.map(({ url, icon: Icon, title }, subIndex) => ( + + {Icon && ( + + )} + {title} + + ))} +
+
+ ))} +
+
+
+ {new Date().getFullYear()} {DUMMY.title}. All rights reserved. +
+
+ {COPYRIGHT_MENU.map(({ url, title }, index) => ( + + {title} + + ))} +
+
+
+ ) } diff --git a/app/pages/news/footer-newsletter.tsx b/app/pages/news/footer-newsletter.tsx index b59b38f..4014912 100644 --- a/app/pages/news/footer-newsletter.tsx +++ b/app/pages/news/footer-newsletter.tsx @@ -9,7 +9,7 @@ export const FooterNewsletter = () => {
= ({ children }) => { {children}
-