feat: centralize brand information in package data and integrate dynamically into contact and footer sections

This commit is contained in:
Firman Ramdhani
2026-07-29 16:44:16 +07:00
parent 90dea678dd
commit 5f87a9f2e3
6 changed files with 27 additions and 20 deletions
-1
View File
@@ -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",
-1
View File
@@ -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",
@@ -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() {
</div>
<div>
<b>{(t as any)(item.titleKey)}</b>
<span>{item.valueKey ? (t as any)(item.valueKey) : item.value}</span>
<span>{item.value}</span>
</div>
</div>
))}
@@ -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() {
<span className="brand-name" style={{ color: '#fff' }}></span>
</div>
<p>{t('Footer.desc')}</p>
<p className="address">{t('Contact.address')}</p>
<p className="address">{brandInfo.address[locale] || brandInfo.address.id}</p>
</div>
<div className="footer-cols">
<div className="footer-col">
@@ -44,8 +46,8 @@ export function Footer() {
</div>
<div className="footer-col">
<h5>{t('Nav.contact')}</h5>
<a href="mailto:hello@pintumasuk.id">hello@pintumasuk.id</a>
<a href="tel:+6281234567890">+62 812-3456-7890</a>
<a href={`mailto:${brandInfo.email}`}>{brandInfo.email}</a>
<a href={`tel:${brandInfo.phone.replace(/[\s-]/g, '')}`}>{brandInfo.phone}</a>
</div>
</div>
</div>
+10 -6
View File
@@ -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/"
}
}
+1
View File
@@ -1,3 +1,4 @@
import brandInfo from './data/info.json';
export type BrandInfo = typeof brandInfo;
export { brandInfo };