@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
36 lines (35 loc) • 2.14 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const react_core_1 = require("@selfcommunity/react-core");
const react_intl_1 = require("react-intl");
const system_1 = require("@mui/system");
const SnippetNotifications_1 = tslib_1.__importDefault(require("../SnippetNotifications"));
const constants_1 = require("./constants");
const classes = {
root: `${constants_1.PREFIX}-notifications-menu-root`,
paper: `${constants_1.PREFIX}-paper`,
notifications: `${constants_1.PREFIX}-notifications`,
link: `${constants_1.PREFIX}-link`
};
const Root = (0, material_1.styled)(material_1.Menu, {
name: constants_1.PREFIX,
slot: 'NotificationsMenuRoot'
})(() => ({}));
function NotificationMenu(inProps) {
// PROPS
const props = (0, system_1.useThemeProps)({
props: inProps,
name: constants_1.PREFIX
});
const { PaperProps = { className: classes.paper }, MenuListProps = { component: material_1.Box }, SnippetNotificationsProps = {} } = props, rest = tslib_1.__rest(props, ["PaperProps", "MenuListProps", "SnippetNotificationsProps"]);
// HOOKS
const scRoutingContext = (0, react_core_1.useSCRouting)();
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
(0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root, PaperProps: PaperProps, MenuListProps: MenuListProps }, rest, { children: [(0, jsx_runtime_1.jsx)(SnippetNotifications_1.default, Object.assign({ className: classes.notifications }, SnippetNotificationsProps)), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ className: classes.link, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}), variant: "text" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.header.notifications.button.seeMore", defaultMessage: "ui.header.notifications.button.seeMore" }) }))] })));
}
exports.default = NotificationMenu;
;