UNPKG

@smitch/fluid

Version:

A lightweight, Tailwind-powered React/Next.js UI component library.

19 lines 1.07 kB
'use client'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { FaRedditAlien } from 'react-icons/fa'; import { Button } from '../..'; var RedditButton = function (_a) { var text = _a.text, btnShape = _a.btnShape, size = _a.size; var handleShareClick = function () { var baseUrl = 'https://www.reddit.com/submit'; var params = new URLSearchParams({ title: text.replace(/(\r\n|\n|\r)/g, ' '), url: window.location.href, }); var shareUrl = "".concat(baseUrl, "?").concat(params.toString()); window.open(shareUrl, '_blank', 'noopener,noreferrer'); }; return (_jsxs(Button, { onClick: handleShareClick, btnBackground: 'danger', btnColor: 'light', layout: btnShape, size: size, title: 'Share on Reddit', className: 'hover:opacity-80 focus:text-light focus-visible:outline-accent bg-[#FF4500]', children: [_jsx(FaRedditAlien, {}), _jsx("span", { className: 'sr-only', children: "Share on Reddit" })] })); }; export default RedditButton; //# sourceMappingURL=RedditButton.js.map