-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* shuffable-cards * update: having 2 sortable contexts * fix: Section splitting through ui * refactor: rename & sheet data feeding * fix: text_content * Feat: sheet changes * feat: social links ui * update: separating states * update: picking multiple images/videos * update: delete image/video * patch: sheet card dragging * update: sortable images/videos * fix: Add Button Stick to top * Feat: Social Links ui * Feat: Functionality of social links * Fix: empty social object * fix: ui changes * fix: Image & Video Screen * small ui change * Feat: check if url is correct through regex --------- Co-authored-by: pratikAgspert <[email protected]>
- Loading branch information
1 parent
3c0822d
commit 3399c28
Showing
19 changed files
with
1,033 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,67 @@ | ||
import { Flex, Image, Link } from "@chakra-ui/react"; | ||
import React from "react"; | ||
import { Flex, Link, Icon } from "@chakra-ui/react"; | ||
import { | ||
FaYoutube, | ||
FaAmazon, | ||
FaFacebookSquare, | ||
FaPinterest, | ||
FaShopify, | ||
} from "react-icons/fa"; | ||
import { IoLogoInstagram } from "react-icons/io"; | ||
|
||
const initialSocialIcons = [ | ||
{ icon: FaYoutube, color: "#ce1312", name: "Youtube" }, | ||
{ icon: FaAmazon, color: "black", name: "Amazon" }, | ||
{ icon: FaFacebookSquare, color: "#4460A0", name: "Facebook" }, | ||
{ icon: FaPinterest, color: "#cc2127", name: "Pinterest" }, | ||
{ icon: FaShopify, color: "#81bf37", name: "Shopify" }, | ||
{ icon: IoLogoInstagram, color: "#d62da6", name: "Instagram" }, | ||
]; | ||
|
||
export const SocialLinks = ({ socialLinks }) => { | ||
console.log("socialLinks:", socialLinks); | ||
|
||
const getIconComponent = (label) => { | ||
const iconInfo = initialSocialIcons.find( | ||
(icon) => icon.name.toLowerCase() === label.toLowerCase() | ||
); | ||
return iconInfo ? iconInfo.icon : null; | ||
}; | ||
|
||
return ( | ||
<Flex justifyContent={"center"} gap={3}> | ||
{socialLinks?.map((link) => ( | ||
<Link | ||
href={link?.url} | ||
isExternal | ||
key={link?.url} | ||
w={"1.5rem"} | ||
h={"1.5rem"} | ||
> | ||
<Image | ||
borderRadius={100} | ||
w={"100%"} | ||
h={"100%"} | ||
src={link?.thumbnail} | ||
alt="thumbnail" | ||
/> | ||
</Link> | ||
))} | ||
<Flex justifyContent={"center"} gap={1}> | ||
{socialLinks?.map((link) => { | ||
const IconComponent = getIconComponent(link.label); | ||
return ( | ||
<Link | ||
href={link?.url} | ||
isExternal | ||
key={link?.id} | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
border={"0.5px solid lightgray"} | ||
borderRadius={"100%"} | ||
p={1} | ||
> | ||
{IconComponent && ( | ||
<Icon | ||
as={IconComponent} | ||
w="100%" | ||
h="100%" | ||
color={ | ||
initialSocialIcons.find( | ||
(icon) => | ||
icon.name.toLowerCase() === link.label.toLowerCase() | ||
)?.color | ||
} | ||
/> | ||
)} | ||
</Link> | ||
); | ||
})} | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default SocialLinks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.