diff --git a/apps/product-site/messages/en.json b/apps/product-site/messages/en.json index fe565c3..df198df 100644 --- a/apps/product-site/messages/en.json +++ b/apps/product-site/messages/en.json @@ -196,7 +196,6 @@ "email": "Email", "phone": "Phone / WhatsApp", "office": "Office", - "address": "Jl. Soekarno-Hatta No.409, Karasak, Kec. Astanaanyar, Bandung City, West Java 40243", "form": { "title": "Send a message to our team", "name": "Full name", diff --git a/apps/product-site/messages/id.json b/apps/product-site/messages/id.json index 02d34d3..7333fba 100644 --- a/apps/product-site/messages/id.json +++ b/apps/product-site/messages/id.json @@ -196,7 +196,6 @@ "email": "Email", "phone": "Telepon / WhatsApp", "office": "Kantor", - "address": "Jl. Soekarno-Hatta No.409, Karasak, Kec. Astanaanyar, Kota Bandung, Jawa Barat 40243", "form": { "title": "Kirim pesan ke tim kami", "name": "Nama lengkap", diff --git a/apps/product-site/src/components/sections/Contact.tsx b/apps/product-site/src/components/sections/Contact.tsx index 36ea2de..f4a78d5 100644 --- a/apps/product-site/src/components/sections/Contact.tsx +++ b/apps/product-site/src/components/sections/Contact.tsx @@ -1,25 +1,27 @@ 'use client'; -import { useTranslations } from 'next-intl'; +import { useTranslations, useLocale } from 'next-intl'; +import { brandInfo } from '@repo/brand'; export function Contact() { const t = useTranslations(); + const locale = useLocale() as 'id' | 'en'; const contactList = [ { icon: 'uil-envelope-alt', titleKey: 'Contact.email', - value: 'hello@pintumasuk.id', + value: brandInfo.email, }, { icon: 'uil-phone', titleKey: 'Contact.phone', - value: '+62 812-3456-7890', + value: brandInfo.phone, }, { icon: 'uil-map-marker', titleKey: 'Contact.office', - valueKey: 'Contact.address', + value: brandInfo.address[locale] || brandInfo.address.id, }, ]; @@ -43,7 +45,7 @@ export function Contact() {
{(t as any)(item.titleKey)} - {item.valueKey ? (t as any)(item.valueKey) : item.value} + {item.value}
))} diff --git a/apps/product-site/src/components/sections/Footer.tsx b/apps/product-site/src/components/sections/Footer.tsx index 8338d87..7ef8ec3 100644 --- a/apps/product-site/src/components/sections/Footer.tsx +++ b/apps/product-site/src/components/sections/Footer.tsx @@ -1,7 +1,9 @@ -import { useTranslations } from 'next-intl'; +import { useTranslations, useLocale } from 'next-intl'; +import { brandInfo } from '@repo/brand'; export function Footer() { const t = useTranslations(); + const locale = useLocale() as 'id' | 'en'; const footerLinks = [ { labelKey: 'Nav.home', href: '#' }, @@ -12,9 +14,9 @@ export function Footer() { ]; const socialLinks = [ - { icon: 'uil-envelope-alt', href: '#' }, - { icon: 'uil-phone', href: '#' }, - { icon: 'uil-youtube', href: '#' }, + { icon: 'uil-envelope-alt', href: brandInfo.socialLinks.email }, + { icon: 'uil-phone', href: brandInfo.socialLinks.phone }, + { icon: 'uil-youtube', href: brandInfo.socialLinks.youtube }, ]; return ( @@ -31,7 +33,7 @@ export function Footer() {

{t('Footer.desc')}

-

{t('Contact.address')}

+

{brandInfo.address[locale] || brandInfo.address.id}

@@ -44,8 +46,8 @@ export function Footer() {
{t('Nav.contact')}
- hello@pintumasuk.id - +62 812-3456-7890 + {brandInfo.email} + {brandInfo.phone}
diff --git a/packages/brand/src/data/info.json b/packages/brand/src/data/info.json index b72a7be..cf7dcd6 100644 --- a/packages/brand/src/data/info.json +++ b/packages/brand/src/data/info.json @@ -1,10 +1,14 @@ { - "name": "My Brand", - "description": "A short description of your brand or product.", - "tagline": "Building the future, one pixel at a time.", + "name": "Pintu Masuk", + "email": "hello@pintumasuk.id", + "phone": "+62 812-3456-7890", + "address": { + "id": "Jl. Soekarno-Hatta No.409, Karasak, Kec. Astanaanyar, Kota Bandung, Jawa Barat 40243", + "en": "Jl. Soekarno-Hatta No.409, Karasak, Kec. Astanaanyar, Bandung City, West Java 40243" + }, "socialLinks": { - "twitter": "https://twitter.com/mybrand", - "github": "https://github.com/mybrand", - "website": "https://mybrand.com" + "email": "mailto:hello@pintumasuk.id", + "phone": "tel:+6281234567890", + "youtube": "https://youtube.com/" } } diff --git a/packages/brand/src/index.ts b/packages/brand/src/index.ts index fb17fae..2712030 100644 --- a/packages/brand/src/index.ts +++ b/packages/brand/src/index.ts @@ -1,3 +1,4 @@ import brandInfo from './data/info.json'; export type BrandInfo = typeof brandInfo; +export { brandInfo };