From b5b1707e0def3cb3615e880649ec6a13526a3a49 Mon Sep 17 00:00:00 2001 From: Salam-vsem Date: Wed, 14 May 2025 00:00:34 +0300 Subject: [PATCH] added social media links --- src/assets/icons/InstagramIcon.tsx | 21 ++++++++++++++++++ src/assets/icons/TelegramIcon.tsx | 18 ++++++++++++++++ src/assets/icons/types.ts | 5 +++++ src/components/Footer.astro | 34 ++++++++++++++++++++++++++---- src/content.config.ts | 14 ++++++++++++ src/content/pages/main.md | 8 +++++++ src/pages/index.astro | 4 ++-- 7 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 src/assets/icons/InstagramIcon.tsx create mode 100644 src/assets/icons/TelegramIcon.tsx create mode 100644 src/assets/icons/types.ts diff --git a/src/assets/icons/InstagramIcon.tsx b/src/assets/icons/InstagramIcon.tsx new file mode 100644 index 0000000..6c82e69 --- /dev/null +++ b/src/assets/icons/InstagramIcon.tsx @@ -0,0 +1,21 @@ +import { forwardRef } from 'react' + +import type { IconProps } from './types' + +export const InstagramIcon = forwardRef( + function InstagramIcon(props, ref) { + return ( + + {' '} + + + ) + } +) diff --git a/src/assets/icons/TelegramIcon.tsx b/src/assets/icons/TelegramIcon.tsx new file mode 100644 index 0000000..4d024ca --- /dev/null +++ b/src/assets/icons/TelegramIcon.tsx @@ -0,0 +1,18 @@ +import { forwardRef } from 'react' + +import type { IconProps } from './types' + +export const TelegramIcon = forwardRef(function TelegramIcon(props, ref) { + return ( + + + + ) +}) diff --git a/src/assets/icons/types.ts b/src/assets/icons/types.ts new file mode 100644 index 0000000..a14cf8a --- /dev/null +++ b/src/assets/icons/types.ts @@ -0,0 +1,5 @@ +import type { SVGAttributes } from 'react' + +export type IconProps = SVGAttributes & { + className?: string +} diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 9e2eb7a..d0a92c3 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -2,16 +2,27 @@ import { useTranslations } from '@/i18n/utils' import { Image } from 'astro:assets' import logoSrc from '@/assets/logo.png' +import type { z } from 'astro:content' +import type { footerSchema } from '@/content.config' +import type React from 'react' +import { TelegramIcon } from '@/assets/icons/TelegramIcon' +import { InstagramIcon } from '@/assets/icons/InstagramIcon' +import type { IconProps } from '@/assets/icons/types' -type Props = { +type Props = z.infer & { lang?: string } -const { lang } = Astro.props +const SOCIAL_MEDIA_ICONS_MAP: Record> = { + telegram: TelegramIcon, + instagram: InstagramIcon, +} + +const { lang, socialMediaLinks } = Astro.props const t = useTranslations(lang) --- -