slate/pages/_/profile.js

49 lines
1.4 KiB
JavaScript
Raw Normal View History

import * as React from "react";
import * as Constants from "~/common/constants";
import { css } from "@emotion/core";
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`
2020-11-01 21:40:03 +03:00
display: block;
grid-template-rows: auto 1fr auto;
2020-08-03 07:29:34 +03:00
text-align: center;
font-size: 1rem;
min-height: 100vh;
2020-11-01 21:40:03 +03:00
background-color: ${Constants.system.white};
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-11-01 21:40:03 +03:00
<Profile {...this.props} />
2020-08-03 07:29:34 +03:00
<WebsitePrototypeFooter />
</div>
</WebsitePrototypeWrapper>
);
}
}