From 77e9ba7c59c78c7fd04c382f0da5cf090f174ac7 Mon Sep 17 00:00:00 2001 From: iAmir Date: Fri, 10 Nov 2023 10:54:46 +0330 Subject: [PATCH] fix how social icons work and fix X logo --- frontend/public/images/assets/x.svg | 2 +- frontend/src/pages/index.tsx | 61 +++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/frontend/public/images/assets/x.svg b/frontend/public/images/assets/x.svg index 203542e9a..99c16c472 100644 --- a/frontend/public/images/assets/x.svg +++ b/frontend/public/images/assets/x.svg @@ -1,4 +1,4 @@ - + diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 5730cafcc..2912e615c 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -12,7 +12,7 @@ import { Text, useColorMode, useColorModeValue, - VStack, + VStack } from "@chakra-ui/react"; import { GetStaticPropsContext } from "next"; import Head from "next/head"; @@ -25,8 +25,9 @@ import { MarkdownContent } from "src/mdx-helpers/types"; //Components import Card from "../components/site/Card"; //Styles -import heroStyles from "../styles/Hero.module.css"; +import React from "react"; import Roads from "src/components/icons/Roads"; +import heroStyles from "../styles/Hero.module.css"; const DownloadButton = (props: { link: string; title: string }) => { return ( @@ -137,31 +138,38 @@ const Home = () => { alt: "discord icon", src: "/images/assets/discord-icon.svg", href: "https://discord.com/invite/samp", + size: 36, }, { alt: "facebook icon", src: "/images/assets/facebook.svg", href: "https://www.facebook.com/openmultiplayer", + size: 33, }, { alt: "instagram icon", src: "/images/assets/instagram.svg", href: "https://instagram.com/openmultiplayer/", + size: 33, }, { alt: "twitch icon", src: "/images/assets/twitch.svg", href: "https://twitch.tv/openmultiplayer", + size: 29, }, { alt: "x icon", src: "/images/assets/x.svg", href: "https://x.com/openmultiplayer", + size: 17, + background: true, }, { alt: "youtube icon", src: "/images/assets/youtube.svg", href: "https://youtube.com/openmultiplayer", + size: 35, }, ]; @@ -238,20 +246,47 @@ const Home = () => {
- {socials.map((social, index) => ( - - {social.alt} - - ))} + {socials.map((social, index) => { + const iconSize = `${social.size}px`; + const style: React.CSSProperties = { + display: "flex", + justifyContent: "center", + ...(social.background && { + backgroundColor: "#7466d4", + width: `${social.size + 12}px`, + height: `${social.size + 12}px`, + borderRadius: 5, + }), + }; + + return ( + + + {social.alt} + + + ); + })}