slate/components/sidebars/SidebarNotifications.js

59 lines
1.3 KiB
JavaScript
Raw Normal View History

import * as React from "react";
import * as Strings from "~/common/strings";
import * as Constants from "~/common/constants";
import * as System from "~/components/system";
2020-11-30 08:24:22 +03:00
import { css } from "@emotion/react";
const STYLES_NOTIFICATION = css`
margin-top: 24px;
font-size: 14px;
`;
const STYLES_NOTIFICATION_DATE = css`
2021-07-07 22:58:14 +03:00
color: ${Constants.system.grayLight2};
`;
const STYLES_NOTIFICATION_BODY = css`
margin-top: 4px;
`;
export default class SidebarNotifications extends React.Component {
state = {};
_handleSubmit = () => {
this.props.onSubmit({});
};
_handleCancel = () => {
this.props.onCancel();
};
_handleChange = (e) => {
this.setState({ [e.target.name]: e.target.value });
};
render() {
return (
<React.Fragment>
2021-07-07 23:50:57 +03:00
<System.P1
2020-09-08 02:28:50 +03:00
style={{
fontFamily: Constants.font.semiBold,
fontSize: Constants.typescale.lvl3,
}}
>
Notifications
2021-07-07 23:50:57 +03:00
</System.P1>
{this.props.viewer.notifications.map((n) => {
return (
<div css={STYLES_NOTIFICATION} key={n.id}>
<div css={STYLES_NOTIFICATION_DATE}>{Strings.toDate(n.createdAt)}</div>
<div css={STYLES_NOTIFICATION_BODY}>{n.text}</div>
</div>
);
})}
</React.Fragment>
);
}
}