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-share-links.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Space } from "antd";67import { Icon } from "@cocalc/frontend/components/icon";8import { COLORS } from "@cocalc/util/theme";9import { CSS } from "components/misc";10import A from "components/misc/A";1112interface SocialMediaShareLinksProps {13title: string;14url: string,15showText?: boolean;16standalone?: boolean; // default false17}1819export function SocialMediaShareLinks(props: SocialMediaShareLinksProps) {20const {21title,22url,23standalone = false,24showText = false,25} = props;2627const bottomLinkStyle: CSS = {28color: COLORS.ANTD_LINK_BLUE,29...(standalone ? { fontSize: "125%", fontWeight: "bold" } : {}),30};3132const srcLink = encodeURIComponent(url);3334return (35<Space size="middle" direction="horizontal">36<A37key="tweet"38href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(39title,40)}&url=${srcLink}&via=cocalc_com`}41style={{ color: COLORS.ANTD_LINK_BLUE, ...bottomLinkStyle }}42>43<Icon name="twitter" />44{showText ? " Tweet" : ""}45</A>46<A47key="facebook"48href={`https://www.facebook.com/sharer/sharer.php?u=${srcLink}`}49style={{ ...bottomLinkStyle }}50>51<Icon name="facebook-filled" />52{showText ? " Share" : ""}53</A>54<A55key="linkedin"56href={`https://www.linkedin.com/sharing/share-offsite/?url=${srcLink}`}57style={{ ...bottomLinkStyle }}58>59<Icon name="linkedin-filled" />60{showText ? " Share" : ""}61</A>62</Space>63);64}656667