fix: footer
This commit is contained in:
+29
-14
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Separator } from '@/components/ui/separator'
|
import { Separator } from '@/components/ui/separator'
|
||||||
import { Call, Location, Sms } from 'iconsax-react'
|
import { Call, Location, Sms, Share } from 'iconsax-react'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
@@ -111,19 +111,34 @@ const Footer: FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex gap-1.5'>
|
<div className='flex gap-1.5'>
|
||||||
{siteSetting.results.siteSetting.socialMediaLinks.map((social) => (
|
{siteSetting.results.siteSetting.socialMediaLinks.map((social) => {
|
||||||
<Link key={social.id} href={social.url} target="_blank" rel="noopener noreferrer">
|
const isValidUrl = (str: string) => {
|
||||||
<div className='size-10 bg-[#878787] hover:bg-primary rounded-full flex justify-center items-center transition-colors'>
|
try {
|
||||||
<Image
|
new URL(str)
|
||||||
src={social.icon}
|
return true
|
||||||
alt='social media'
|
} catch {
|
||||||
width={20}
|
return false
|
||||||
height={20}
|
}
|
||||||
className='w-5 h-5 object-contain brightness-0 invert'
|
}
|
||||||
/>
|
|
||||||
</div>
|
return (
|
||||||
</Link>
|
<Link key={social.id} href={social.url} target="_blank" rel="noopener noreferrer">
|
||||||
))}
|
<div className='size-10 bg-[#878787] hover:bg-primary rounded-full flex justify-center items-center transition-colors'>
|
||||||
|
{isValidUrl(social.icon) ? (
|
||||||
|
<Image
|
||||||
|
src={social.icon}
|
||||||
|
alt='social media'
|
||||||
|
width={20}
|
||||||
|
height={20}
|
||||||
|
className='w-5 h-5 object-contain brightness-0 invert'
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Share size={20} className='text-white' />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user