2020-08-22 07:25:34 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
2020-11-30 08:24:22 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-11-26 02:19:02 +03:00
|
|
|
|
|
|
|
import ProcessedText from "~/components/core/ProcessedText";
|
2020-08-22 07:25:34 +03:00
|
|
|
|
|
|
|
const STYLES_ROOT = css`
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-start;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
2021-01-22 00:53:33 +03:00
|
|
|
|
|
|
|
@media (max-width: ${Constants.sizes.mobile}px) {
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
2020-08-22 07:25:34 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_LEFT = css`
|
|
|
|
min-width: 10%;
|
|
|
|
width: 100%;
|
2021-01-21 10:02:35 +03:00
|
|
|
|
|
|
|
@media (min-width: ${Constants.sizes.mobile}px) {
|
|
|
|
padding-right: 24px;
|
|
|
|
}
|
2020-08-22 07:25:34 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_RIGHT = css`
|
|
|
|
flex-shrink: 0;
|
2020-08-31 21:19:46 +03:00
|
|
|
justify-self: end;
|
2020-08-22 07:25:34 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_HEADER = css`
|
|
|
|
box-sizing: border-box;
|
2020-09-01 07:44:56 +03:00
|
|
|
font-family: ${Constants.font.medium};
|
2020-08-26 00:58:38 +03:00
|
|
|
font-size: ${Constants.typescale.lvl4};
|
2020-08-22 07:25:34 +03:00
|
|
|
padding: 0;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2020-10-05 00:30:28 +03:00
|
|
|
max-width: 800px;
|
2020-08-22 07:25:34 +03:00
|
|
|
white-space: pre-wrap;
|
|
|
|
overflow-wrap: break-word;
|
2020-10-01 03:41:53 +03:00
|
|
|
|
|
|
|
@media (max-width: ${Constants.sizes.mobile}px) {
|
|
|
|
font-size: ${Constants.typescale.lvl3};
|
|
|
|
}
|
2020-08-22 07:25:34 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
const STYLES_DESCRIPTION = css`
|
|
|
|
box-sizing: border-box;
|
|
|
|
font-family: ${Constants.font.text};
|
2020-08-26 00:58:38 +03:00
|
|
|
font-size: ${Constants.typescale.lvl1};
|
2021-07-07 22:58:14 +03:00
|
|
|
color: ${Constants.system.grayLight2};
|
2020-08-22 07:25:34 +03:00
|
|
|
margin-bottom: 12px;
|
|
|
|
line-height: 1.5;
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2020-10-05 00:30:28 +03:00
|
|
|
max-width: 800px;
|
2020-08-22 07:25:34 +03:00
|
|
|
white-space: pre-wrap;
|
|
|
|
overflow-wrap: break-word;
|
2021-02-22 13:56:56 +03:00
|
|
|
ul,
|
|
|
|
ol {
|
|
|
|
white-space: normal;
|
|
|
|
}
|
2020-08-22 07:25:34 +03:00
|
|
|
`;
|
|
|
|
|
2020-08-30 23:31:09 +03:00
|
|
|
export const ScenePageHeader = (props) => {
|
2020-08-22 07:25:34 +03:00
|
|
|
return (
|
|
|
|
<header css={STYLES_ROOT} style={props.style}>
|
|
|
|
<div css={STYLES_LEFT}>
|
|
|
|
<div css={STYLES_HEADER}>{props.title}</div>
|
2020-08-27 09:03:30 +03:00
|
|
|
<div css={STYLES_DESCRIPTION}>
|
|
|
|
<ProcessedText text={props.children} />
|
|
|
|
</div>
|
2020-08-22 07:25:34 +03:00
|
|
|
</div>
|
2020-08-26 11:11:13 +03:00
|
|
|
{props.actions ? <div css={STYLES_RIGHT}>{props.actions}</div> : null}
|
2020-08-22 07:25:34 +03:00
|
|
|
</header>
|
|
|
|
);
|
|
|
|
};
|
2020-08-30 23:31:09 +03:00
|
|
|
|
|
|
|
export default ScenePageHeader;
|