mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-23 14:07:20 +03:00
misc style changes
This commit is contained in:
parent
26f9804bd7
commit
c8607d54f4
@ -481,9 +481,11 @@ export default class ApplicationPage extends React.Component {
|
|||||||
|
|
||||||
// NOTE(jim): Authenticated.
|
// NOTE(jim): Authenticated.
|
||||||
const navigation = NavigationData.generate(this.state.viewer);
|
const navigation = NavigationData.generate(this.state.viewer);
|
||||||
|
console.log(navigation);
|
||||||
const next = this.state.history[this.state.currentIndex];
|
const next = this.state.history[this.state.currentIndex];
|
||||||
const current = NavigationData.getCurrentById(navigation, next.id);
|
const current = NavigationData.getCurrentById(navigation, next.id);
|
||||||
console.log(this.state.history);
|
console.log(this.state.history);
|
||||||
|
console.log(current);
|
||||||
|
|
||||||
const navigationElement = (
|
const navigationElement = (
|
||||||
<ApplicationNavigation
|
<ApplicationNavigation
|
||||||
|
@ -2,6 +2,7 @@ import * as React from "react";
|
|||||||
import * as Constants from "~/common/constants";
|
import * as Constants from "~/common/constants";
|
||||||
|
|
||||||
import { css } from "@emotion/react";
|
import { css } from "@emotion/react";
|
||||||
|
import { ProcessedText } from "~/components/system/components/Typography";
|
||||||
|
|
||||||
import SlatePreviewBlock from "~/components/core/SlatePreviewBlock";
|
import SlatePreviewBlock from "~/components/core/SlatePreviewBlock";
|
||||||
|
|
||||||
@ -23,7 +24,18 @@ const STYLES_PROFILE_IMAGE = css`
|
|||||||
|
|
||||||
const STYLES_NAME = css`
|
const STYLES_NAME = css`
|
||||||
font-size: ${Constants.typescale.lvl3};
|
font-size: ${Constants.typescale.lvl3};
|
||||||
margin: 16px 0px;
|
width: 100%;
|
||||||
|
max-width: 420px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 24px 0 24px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const STYLES_DESCRIPTION = css`
|
||||||
|
font-size: ${Constants.typescale.lvl1};
|
||||||
|
width: 100%;
|
||||||
|
max-width: 420px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 24px 0 24px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const STYLES_LINK = css`
|
const STYLES_LINK = css`
|
||||||
@ -40,11 +52,22 @@ export default class Profile extends React.Component {
|
|||||||
css={STYLES_PROFILE_IMAGE}
|
css={STYLES_PROFILE_IMAGE}
|
||||||
style={{ backgroundImage: `url('${data.data.photo}')` }}
|
style={{ backgroundImage: `url('${data.data.photo}')` }}
|
||||||
/>
|
/>
|
||||||
<div css={STYLES_NAME}>{data.username}</div>
|
<br />
|
||||||
|
<div css={STYLES_NAME}>{data.data.name || data.username}</div>
|
||||||
|
<br />
|
||||||
|
{data.data.body ? (
|
||||||
|
<React.Fragment>
|
||||||
|
<div css={STYLES_DESCRIPTION}>
|
||||||
|
<ProcessedText text={data.data.body} />
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
</React.Fragment>
|
||||||
|
) : null}
|
||||||
|
<br />
|
||||||
{this.props.buttons}
|
{this.props.buttons}
|
||||||
<br />
|
<br />
|
||||||
{data.slates && data.slates.length ? (
|
{data.slates && data.slates.length ? (
|
||||||
<div style={{ width: "100%" }}>
|
<div>
|
||||||
{data.slates.map((slate) => {
|
{data.slates.map((slate) => {
|
||||||
const url = `/${data.username}/${slate.slatename}`;
|
const url = `/${data.username}/${slate.slatename}`;
|
||||||
if (this.props.onAction) {
|
if (this.props.onAction) {
|
||||||
|
@ -28,12 +28,19 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
name: this.state.name,
|
name: this.state.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
|
|
||||||
if (response && response.error) {
|
if (response && response.error) {
|
||||||
// TODO(jim): Error task.
|
// TODO(jim): Error task.
|
||||||
alert(response.decorator);
|
alert(response.decorator);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
|
this.props.onAction({
|
||||||
|
type: "NAVIGATE",
|
||||||
|
value: response.slate.id,
|
||||||
|
data: response.slate,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_handleCancel = () => {
|
_handleCancel = () => {
|
||||||
|
@ -37,7 +37,7 @@ export default class ProfilePage extends React.Component {
|
|||||||
>
|
>
|
||||||
<div css={STYLES_ROOT}>
|
<div css={STYLES_ROOT}>
|
||||||
<WebsitePrototypeHeader />
|
<WebsitePrototypeHeader />
|
||||||
<div style={{ marginTop: "80px" }}>
|
<div style={{ margin: "80px 24px 0px 24px" }}>
|
||||||
<Profile {...this.props} />
|
<Profile {...this.props} />
|
||||||
</div>
|
</div>
|
||||||
<WebsitePrototypeFooter />
|
<WebsitePrototypeFooter />
|
||||||
|
@ -239,7 +239,6 @@ export default class SceneDirectory extends React.Component {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScenePage>
|
<ScenePage>
|
||||||
<ScenePageHeader title="Directory" />
|
<ScenePageHeader title="Directory" />
|
||||||
|
@ -5,7 +5,10 @@ import * as Constants from "~/common/constants";
|
|||||||
import * as SVG from "~/components/system/svg";
|
import * as SVG from "~/components/system/svg";
|
||||||
|
|
||||||
import { css } from "@emotion/react";
|
import { css } from "@emotion/react";
|
||||||
import { ButtonPrimary } from "~/components/system/components/Buttons";
|
import {
|
||||||
|
ButtonPrimary,
|
||||||
|
ButtonSecondary,
|
||||||
|
} from "~/components/system/components/Buttons";
|
||||||
|
|
||||||
import ScenePage from "~/components/core/ScenePage";
|
import ScenePage from "~/components/core/ScenePage";
|
||||||
import Profile from "~/components/core/Profile";
|
import Profile from "~/components/core/Profile";
|
||||||
@ -19,18 +22,6 @@ const BUTTON_STYLES = {
|
|||||||
minHeight: "30px",
|
minHeight: "30px",
|
||||||
};
|
};
|
||||||
|
|
||||||
const BUTTON_SECONDARY_STYLE = {
|
|
||||||
...BUTTON_STYLES,
|
|
||||||
backgroundColor: Constants.system.white,
|
|
||||||
color: Constants.system.brand,
|
|
||||||
};
|
|
||||||
|
|
||||||
const BUTTON_PRIMARY_STYLE = {
|
|
||||||
...BUTTON_STYLES,
|
|
||||||
backgroundColor: Constants.system.brand,
|
|
||||||
color: Constants.system.white,
|
|
||||||
};
|
|
||||||
|
|
||||||
const STATUS_BUTTON_MAP = {
|
const STATUS_BUTTON_MAP = {
|
||||||
trusted: "Remove peer",
|
trusted: "Remove peer",
|
||||||
untrusted: "Add peer",
|
untrusted: "Add peer",
|
||||||
@ -151,36 +142,46 @@ export default class SceneProfile extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
let buttons = (
|
let buttons = (
|
||||||
<div>
|
<div>
|
||||||
<ButtonPrimary
|
{this.state.followStatus ? (
|
||||||
style={
|
<ButtonSecondary
|
||||||
this.state.followStatus
|
style={{ margin: "0px 8px" }}
|
||||||
? BUTTON_SECONDARY_STYLE
|
onClick={this._handleFollow}
|
||||||
: BUTTON_PRIMARY_STYLE
|
>
|
||||||
}
|
Unfollow
|
||||||
onClick={this._handleFollow}
|
</ButtonSecondary>
|
||||||
>
|
) : (
|
||||||
{this.state.followStatus ? "Unfollow" : "Follow"}
|
<ButtonPrimary
|
||||||
</ButtonPrimary>
|
style={{ margin: "0px 8px" }}
|
||||||
<ButtonPrimary
|
onClick={this._handleFollow}
|
||||||
style={
|
>
|
||||||
this.state.trustStatus === "untrusted" ||
|
Follow
|
||||||
this.state.trustStatus === "received"
|
</ButtonPrimary>
|
||||||
? BUTTON_PRIMARY_STYLE
|
)}
|
||||||
: BUTTON_SECONDARY_STYLE
|
{this.state.trustStatus === "untrusted" ||
|
||||||
}
|
this.state.trustStatus === "received" ? (
|
||||||
onClick={this._handleTrust}
|
<ButtonPrimary
|
||||||
>
|
style={{ margin: "0px 8px" }}
|
||||||
{STATUS_BUTTON_MAP[this.state.trustStatus]}
|
onClick={this._handleTrust}
|
||||||
</ButtonPrimary>
|
>
|
||||||
{this.state.isTrusted ? (
|
{STATUS_BUTTON_MAP[this.state.trustStatus]}
|
||||||
|
</ButtonPrimary>
|
||||||
|
) : (
|
||||||
|
<ButtonSecondary
|
||||||
|
style={{ margin: "0px 8px" }}
|
||||||
|
onClick={this._handleTrust}
|
||||||
|
>
|
||||||
|
{STATUS_BUTTON_MAP[this.state.trustStatus]}
|
||||||
|
</ButtonSecondary>
|
||||||
|
)}
|
||||||
|
{/* {this.state.trustStatus === "trusted" ? (
|
||||||
<ButtonPrimary style={BUTTON_STYLE} onClick={this._handleSendMoney}>
|
<ButtonPrimary style={BUTTON_STYLE} onClick={this._handleSendMoney}>
|
||||||
Send Money
|
Send Money
|
||||||
</ButtonPrimary>
|
</ButtonPrimary>
|
||||||
) : null}
|
) : null} */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<ScenePage style={{ padding: `88px 24px 128px 24px` }}>
|
<ScenePage>
|
||||||
<Profile
|
<Profile
|
||||||
onAction={this.props.onAction}
|
onAction={this.props.onAction}
|
||||||
creator={this.props.data}
|
creator={this.props.data}
|
||||||
|
@ -5,6 +5,7 @@ import * as Constants from "~/common/constants";
|
|||||||
import * as SVG from "~/components/system/svg";
|
import * as SVG from "~/components/system/svg";
|
||||||
|
|
||||||
import { css } from "@emotion/react";
|
import { css } from "@emotion/react";
|
||||||
|
import { ProcessedText } from "~/components/system/components/Typography";
|
||||||
|
|
||||||
import ScenePage from "~/components/core/ScenePage";
|
import ScenePage from "~/components/core/ScenePage";
|
||||||
import ScenePageHeader from "~/components/core/ScenePageHeader";
|
import ScenePageHeader from "~/components/core/ScenePageHeader";
|
||||||
@ -325,7 +326,7 @@ export default class SceneSlate extends React.Component {
|
|||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{body}
|
<ProcessedText text={body} />
|
||||||
</ScenePageHeader>
|
</ScenePageHeader>
|
||||||
<Slate
|
<Slate
|
||||||
key={slatename}
|
key={slatename}
|
||||||
|
Loading…
Reference in New Issue
Block a user