2020-04-09 00:29:13 +03:00
|
|
|
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";
|
2020-04-09 00:29:13 +03:00
|
|
|
|
|
|
|
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};
|
2020-04-09 00:29:13 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
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,
|
|
|
|
}}
|
|
|
|
>
|
2020-04-09 00:29:13 +03:00
|
|
|
Notifications
|
2021-07-07 23:50:57 +03:00
|
|
|
</System.P1>
|
2020-04-09 00:29:13 +03:00
|
|
|
{this.props.viewer.notifications.map((n) => {
|
|
|
|
return (
|
|
|
|
<div css={STYLES_NOTIFICATION} key={n.id}>
|
2020-11-04 20:55:48 +03:00
|
|
|
<div css={STYLES_NOTIFICATION_DATE}>{Strings.toDate(n.createdAt)}</div>
|
2020-04-09 00:29:13 +03:00
|
|
|
<div css={STYLES_NOTIFICATION_BODY}>{n.text}</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|