Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/components/landing/social-media-icon-list.tsx
Views: 687
import React from "react";1import { Flex } from "antd";23import { Icon, IconName } from "@cocalc/frontend/components/icon";4import { COLORS } from "@cocalc/util/theme";56enum SocialMediaType {7FACEBOOK = "facebook",8GITHUB = "github",9INSTAGRAM = "instagram",10LINKEDIN = "linkedin",11TWITTER = "twitter",12YOUTUBE = "youtube",13}1415const ICON_MAP: Record<SocialMediaType, IconName> = {16[SocialMediaType.FACEBOOK]: "facebook-filled",17[SocialMediaType.GITHUB]: "github",18[SocialMediaType.INSTAGRAM]: "instagram",19[SocialMediaType.LINKEDIN]: "linkedin-filled",20[SocialMediaType.TWITTER]: "twitter",21[SocialMediaType.YOUTUBE]: "youtube-filled",22};2324export interface SocialMediaIconListProps {25links: Partial<Record<SocialMediaType, string>>;26iconFontSize?: number;27style?: React.CSSProperties;28}2930export default function SocialMediaIconList(props: SocialMediaIconListProps) {31const { links, iconFontSize = 12, style = {} } = props;3233return (34<Flex35align="center"36wrap="wrap"37style={{38fontSize: `${iconFontSize}px`,39...style,40}}41>42{Object.keys(links)43.sort()44.map((mediaType: SocialMediaType) => (45<a46key={mediaType}47href={links[mediaType]}48target="_blank"49style={{50color: COLORS.GRAY,51}}52>53<Icon54name={ICON_MAP[mediaType]}55style={{ margin: `0 ${iconFontSize / 2}px` }}56/>57</a>58))}59</Flex>60);61}626364