From c8607d54f4bee69b9f0ec82303d269878f5381f3 Mon Sep 17 00:00:00 2001 From: Martina Date: Wed, 2 Sep 2020 14:08:32 -0700 Subject: [PATCH] misc style changes --- components/core/Application.js | 2 + components/core/Profile.js | 29 ++++++++- components/sidebars/SidebarCreateSlate.js | 7 +++ pages/_/profile.js | 2 +- scenes/SceneDirectory.js | 1 - scenes/SceneProfile.js | 75 ++++++++++++----------- scenes/SceneSlate.js | 3 +- 7 files changed, 76 insertions(+), 43 deletions(-) diff --git a/components/core/Application.js b/components/core/Application.js index 1ede4b71..42398906 100644 --- a/components/core/Application.js +++ b/components/core/Application.js @@ -481,9 +481,11 @@ export default class ApplicationPage extends React.Component { // NOTE(jim): Authenticated. const navigation = NavigationData.generate(this.state.viewer); + console.log(navigation); const next = this.state.history[this.state.currentIndex]; const current = NavigationData.getCurrentById(navigation, next.id); console.log(this.state.history); + console.log(current); const navigationElement = ( -
{data.username}
+
+
{data.data.name || data.username}
+
+ {data.data.body ? ( + +
+ +
+
+
+ ) : null} +
{this.props.buttons}
{data.slates && data.slates.length ? ( -
+
{data.slates.map((slate) => { const url = `/${data.username}/${slate.slatename}`; if (this.props.onAction) { diff --git a/components/sidebars/SidebarCreateSlate.js b/components/sidebars/SidebarCreateSlate.js index 9c5222ee..68dc583a 100644 --- a/components/sidebars/SidebarCreateSlate.js +++ b/components/sidebars/SidebarCreateSlate.js @@ -28,12 +28,19 @@ export default class SidebarCreateSlate extends React.Component { name: this.state.name, }); + console.log(response); + if (response && response.error) { // TODO(jim): Error task. alert(response.decorator); } this.setState({ loading: false }); + this.props.onAction({ + type: "NAVIGATE", + value: response.slate.id, + data: response.slate, + }); }; _handleCancel = () => { diff --git a/pages/_/profile.js b/pages/_/profile.js index 6ddb745a..df811cab 100644 --- a/pages/_/profile.js +++ b/pages/_/profile.js @@ -37,7 +37,7 @@ export default class ProfilePage extends React.Component { >
-
+
diff --git a/scenes/SceneDirectory.js b/scenes/SceneDirectory.js index cfe03457..755b4387 100644 --- a/scenes/SceneDirectory.js +++ b/scenes/SceneDirectory.js @@ -239,7 +239,6 @@ export default class SceneDirectory extends React.Component { /> ); }); - return ( diff --git a/scenes/SceneProfile.js b/scenes/SceneProfile.js index 5428cc78..85a6a3b0 100644 --- a/scenes/SceneProfile.js +++ b/scenes/SceneProfile.js @@ -5,7 +5,10 @@ import * as Constants from "~/common/constants"; import * as SVG from "~/components/system/svg"; 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 Profile from "~/components/core/Profile"; @@ -19,18 +22,6 @@ const BUTTON_STYLES = { 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 = { trusted: "Remove peer", untrusted: "Add peer", @@ -151,36 +142,46 @@ export default class SceneProfile extends React.Component { render() { let buttons = (
- - {this.state.followStatus ? "Unfollow" : "Follow"} - - - {STATUS_BUTTON_MAP[this.state.trustStatus]} - - {this.state.isTrusted ? ( + {this.state.followStatus ? ( + + Unfollow + + ) : ( + + Follow + + )} + {this.state.trustStatus === "untrusted" || + this.state.trustStatus === "received" ? ( + + {STATUS_BUTTON_MAP[this.state.trustStatus]} + + ) : ( + + {STATUS_BUTTON_MAP[this.state.trustStatus]} + + )} + {/* {this.state.trustStatus === "trusted" ? ( Send Money - ) : null} + ) : null} */}
); return ( - + - {body} +