@prezly/theme-kit-ui
Version:
UI components for Prezly themes
67 lines • 3.32 kB
JavaScript
import React from "react";
import { ArrowUpRightIcon } from '@heroicons/react/24/outline';
import { Link } from "../Link/index.mjs";
import { SocialMedia } from "../StoryShareLinks/index.mjs";
import { SubFooter } from "./SubFooter.mjs";
import { hasAnySocialMedia } from "./util.mjs";
export function Footer(_ref) {
var _intl$allStoriesTitl, _intl$boilerplateAbo, _intl$mediaGalleryTi, _intl$contactsTitle;
var {
className,
companySocials,
externalSiteLink,
hasStandaloneAboutPage,
hasStandaloneContactsPage,
newsroomName,
publicGalleriesCount,
isWhiteLabeled,
intl = {},
privacyRequestLink
} = _ref;
var hasSocialMedia = hasAnySocialMedia(companySocials);
return /*#__PURE__*/React.createElement("footer", {
className: className
}, /*#__PURE__*/React.createElement("div", {
className: "p-12 flex flex-col md:flex-row bg-gray-900 justify-between"
}, /*#__PURE__*/React.createElement("div", {
className: "flex flex-col gap-6"
}, hasSocialMedia && /*#__PURE__*/React.createElement(SocialMedia, {
iconClassName: "text-white hover:text-gray-400",
companySocials: companySocials
}), /*#__PURE__*/React.createElement("div", {
className: "hidden md:flex items-center gap-6 mt-auto"
}, externalSiteLink && /*#__PURE__*/React.createElement(Link, {
className: "text-white hover:text-white hover:underline mt-auto ",
href: externalSiteLink,
icon: ArrowUpRightIcon,
iconPlacement: "right",
target: "_blank",
rel: "noopener noreferrer"
}, new URL(externalSiteLink).hostname))), /*#__PURE__*/React.createElement("div", {
className: "flex flex-col md:items-end mt-6 md:mt-0 gap-6"
}, /*#__PURE__*/React.createElement(Link, {
className: "text-white hover:text-white hover:underline",
href: "/stories"
}, (_intl$allStoriesTitl = intl['allStories.title']) !== null && _intl$allStoriesTitl !== void 0 ? _intl$allStoriesTitl : 'All stories'), hasStandaloneAboutPage && /*#__PURE__*/React.createElement(Link, {
className: "text-white hover:text-white hover:underline",
href: "/about"
}, (_intl$boilerplateAbo = intl['boilerplate.about']) !== null && _intl$boilerplateAbo !== void 0 ? _intl$boilerplateAbo : 'About'), publicGalleriesCount > 0 && /*#__PURE__*/React.createElement(Link, {
className: "text-white hover:text-white hover:underline",
href: "/media"
}, (_intl$mediaGalleryTi = intl['mediaGallery.title']) !== null && _intl$mediaGalleryTi !== void 0 ? _intl$mediaGalleryTi : 'Media'), hasStandaloneContactsPage && /*#__PURE__*/React.createElement(Link, {
className: "text-white hover:text-white hover:underline",
href: "/contacts"
}, (_intl$contactsTitle = intl['contacts.title']) !== null && _intl$contactsTitle !== void 0 ? _intl$contactsTitle : 'Contacts'), externalSiteLink && /*#__PURE__*/React.createElement(Link, {
className: "flex md:hidden text-white hover:text-white hover:underline mt-auto ",
href: externalSiteLink,
icon: ArrowUpRightIcon,
iconPlacement: "right",
target: "_blank",
rel: "noopener noreferrer"
}, new URL(externalSiteLink).hostname))), /*#__PURE__*/React.createElement(SubFooter, {
intl: intl,
isWhiteLabeled: isWhiteLabeled,
newsroomDisplayName: newsroomName,
privacyRequestLink: privacyRequestLink
}));
}