slate/pages/_/profile.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

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