2020-07-22 10:41:29 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
|
|
|
import { css } from "@emotion/react";
|
|
|
|
|
2020-09-03 06:26:56 +03:00
|
|
|
import Profile from "~/components/core/Profile";
|
2020-07-22 10:41:29 +03:00
|
|
|
import WebsitePrototypeWrapper from "~/components/core/WebsitePrototypeWrapper";
|
2020-08-03 07:29:34 +03:00
|
|
|
import WebsitePrototypeHeader from "~/components/core/WebsitePrototypeHeader";
|
|
|
|
import WebsitePrototypeFooter from "~/components/core/WebsitePrototypeFooter";
|
2020-07-22 10:41:29 +03:00
|
|
|
|
|
|
|
export const getServerSideProps = async (context) => {
|
|
|
|
return {
|
|
|
|
props: { ...context.query },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const STYLES_ROOT = css`
|
2020-08-31 21:19:46 +03:00
|
|
|
display: grid;
|
|
|
|
grid-template-rows: auto 1fr auto;
|
2020-08-03 07:29:34 +03:00
|
|
|
text-align: center;
|
|
|
|
font-size: 1rem;
|
2020-08-31 21:19:46 +03:00
|
|
|
min-height: 100vh;
|
2020-08-03 07:29:34 +03:00
|
|
|
`;
|
2020-07-22 10:41:29 +03:00
|
|
|
|
2020-08-25 00:15:51 +03:00
|
|
|
export default class ProfilePage extends React.Component {
|
2020-07-22 10:41:29 +03:00
|
|
|
render() {
|
2020-08-07 02:06:54 +03:00
|
|
|
const title = this.props.creator ? `${this.props.creator.username}` : "404";
|
2020-07-22 22:17:08 +03:00
|
|
|
const url = `https://slate.host/${title}`;
|
2020-08-22 08:45:50 +03:00
|
|
|
const description = this.props.creator.data.body;
|
2020-07-22 10:41:29 +03:00
|
|
|
|
|
|
|
return (
|
2020-08-03 07:29:34 +03:00
|
|
|
<WebsitePrototypeWrapper
|
|
|
|
title={title}
|
|
|
|
description={description}
|
|
|
|
url={url}
|
|
|
|
image={this.props.creator.data.photo}
|
|
|
|
>
|
2020-07-22 10:41:29 +03:00
|
|
|
<div css={STYLES_ROOT}>
|
2020-08-03 07:29:34 +03:00
|
|
|
<WebsitePrototypeHeader />
|
2020-09-03 00:08:32 +03:00
|
|
|
<div style={{ margin: "80px 24px 0px 24px" }}>
|
2020-08-31 21:19:46 +03:00
|
|
|
<Profile {...this.props} />
|
2020-08-28 05:13:31 +03:00
|
|
|
</div>
|
2020-08-03 07:29:34 +03:00
|
|
|
<WebsitePrototypeFooter />
|
2020-07-22 10:41:29 +03:00
|
|
|
</div>
|
|
|
|
</WebsitePrototypeWrapper>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|