diff --git a/common/navigation-data.js b/common/navigation-data.js index f0420b7a..54347ea9 100644 --- a/common/navigation-data.js +++ b/common/navigation-data.js @@ -75,6 +75,14 @@ export const generate = ({ library = [], slates = [] }) => [ children: null, ignore: true, }, + { + id: "V1_NAVIGATION_SLATES_FOLLOWING", + decorator: "SLATES_FOLLOWING", + name: "Slates", + pageTitle: "Slates", + children: null, + ignore: true, + }, { id: "V1_NAVIGATION_DIRECTORY", decorator: "DIRECTORY", @@ -82,6 +90,14 @@ export const generate = ({ library = [], slates = [] }) => [ pageTitle: "Your directory", children: null, }, + { + id: "V1_NAVIGATION_DIRECTORY_FOLLOWERS", + decorator: "DIRECTORY_FOLLOWERS", + name: "Directory", + pageTitle: "Your directory", + children: null, + ignore: true, + }, { id: "V1_NAVIGATION_SLATE", decorator: "PUBLIC_SLATE", diff --git a/common/svg.js b/common/svg.js index 5c02911e..726bc311 100644 --- a/common/svg.js +++ b/common/svg.js @@ -1637,7 +1637,7 @@ export const Filter = (props) => ( ); -export const Menu = (props) => ( +export const MenuAlt = (props) => ( ( ); +export const Menu = (props) => ( + + + +); + export const Globe = (props) => ( , SETTINGS_DEVELOPER: , EDIT_ACCOUNT: , - SLATES: , + SLATES: , + SLATES_FOLLOWING: , LOCAL_DATA: , - DIRECTORY: , + DIRECTORY: , + DIRECTORY_FOLLOWERS: , FILECOIN: , MAKE_DEAL: , }; diff --git a/components/core/ApplicationHeader.js b/components/core/ApplicationHeader.js index 722f9d14..33356168 100644 --- a/components/core/ApplicationHeader.js +++ b/components/core/ApplicationHeader.js @@ -232,7 +232,7 @@ export default class ApplicationHeader extends React.Component { ) : null} - + this.props.onAdd(slate)} > -
- {selected[slate.id] ? ( - - ) : ( - - )} -
- {Strings.getPresentationSlateName(slate)} +
+ {selected[slate.id] ? ( + + ) : ( + + )} +
+
+ {Strings.getPresentationSlateName(slate)} +
+ {slate.data.public ? ( +
+ +
+ ) : ( +
+ +
+ )} ))} diff --git a/components/core/SlatePreviewBlock.js b/components/core/SlatePreviewBlock.js index bdd30597..490be2e5 100644 --- a/components/core/SlatePreviewBlock.js +++ b/components/core/SlatePreviewBlock.js @@ -429,31 +429,14 @@ export class SlatePreviewBlock extends React.Component {
{this.props.slate.data.name}
- {this.props.isOwner ? ( - this.props.slate.data.public ? ( -
- Public -
- ) : ( -
- Private -
- ) - ) : ( -
- )} +
+ {this.props.isOwner && !this.props.slate.data.public ? ( + + ) : null} +
{this.props.username ? (
- {this.props.slate.data.body ? ( -
{this.props.slate.data.body}
- ) : this.props.isOwner ? ( -
- ) : ( -
- )} +
+ {this.props.slate.data.body ? ( +
{this.props.slate.data.body}
+ ) : this.props.isOwner ? ( +
+ ) : ( +
+ )} +
+// Public +//
+// ) : ( +//
+// Private +//
+// ) diff --git a/components/sidebars/SidebarSingleSlateSettings.js b/components/sidebars/SidebarSingleSlateSettings.js index 43cb3d4b..baae0811 100644 --- a/components/sidebars/SidebarSingleSlateSettings.js +++ b/components/sidebars/SidebarSingleSlateSettings.js @@ -91,27 +91,31 @@ export default class SidebarSingleSlateSettings extends React.Component { }; _handleDelete = async (e) => { - this.setState({ loading: true }); + // this.setState({ loading: true }); if ( !window.confirm("Are you sure you want to delete this Slate? This action is irreversible.") ) { - return this.setState({ loading: false }); + return; + // return this.setState({ loading: false }); } + let slates = this.props.viewer.slates.filter((slate) => slate.id !== this.props.current.id); + this.props.onUpdateViewer({ slates }); + + this.props.onAction({ + type: "NAVIGATE", + value: "V1_NAVIGATION_SLATES", + }); + const response = await Actions.deleteSlate({ id: this.props.current.id, }); if (Events.hasError(response)) { - this.setState({ loading: false }); + // this.setState({ loading: false }); return; } - - await this.props.onAction({ - type: "NAVIGATE", - value: "V1_NAVIGATION_SLATES", - }); }; render() { diff --git a/components/system/components/GlobalCarousel.js b/components/system/components/GlobalCarousel.js index 8e71c5ed..51c3eda2 100644 --- a/components/system/components/GlobalCarousel.js +++ b/components/system/components/GlobalCarousel.js @@ -79,7 +79,7 @@ const STYLES_EXPANDER = css` position: absolute; padding: 4px; top: 16px; - right: 16px; + left: 16px; cursor: pointer; :hover { @@ -95,12 +95,12 @@ const STYLES_DISMISS_BOX = css` cursor: pointer; :hover { - color: ${Constants.system.black}; + color: ${Constants.system.white}; } - @media (min-width: ${Constants.sizes.mobile}px) { + ${"" /* @media (min-width: ${Constants.sizes.mobile}px) { display: none; - } + } */} `; const STYLES_MOBILE_HIDDEN = css` @@ -366,20 +366,27 @@ export class GlobalCarousel extends React.Component { {slide} -
this.setState({ showSidebar: !this.state.showSidebar })} - > - {this.state.showSidebar ? ( + {this.state.showSidebar ? ( +
this.setState({ showSidebar: !this.state.showSidebar })} + > - ) : ( - - )} -
+
+ ) : ( +
+
this.setState({ showSidebar: !this.state.showSidebar })} + > + +
+
+ +
+
+ )}
-
- -
{this.state.carouselType === "data" ? ( diff --git a/scenes/SceneDirectory.js b/scenes/SceneDirectory.js index 8ca093bc..359d725b 100644 --- a/scenes/SceneDirectory.js +++ b/scenes/SceneDirectory.js @@ -138,7 +138,6 @@ export default class SceneDirectory extends React.Component { state = { copyValue: "", - tab: 0, contextMenu: null, }; @@ -476,10 +475,16 @@ export default class SceneDirectory extends React.Component { this.setState({ tab: value })} + value={this.props.tab} + onChange={(value) => { + if (value === 0) { + this.props.onAction({ type: "NAVIGATE", value: "V1_NAVIGATION_DIRECTORY" }); + } else { + this.props.onAction({ type: "NAVIGATE", value: "V1_NAVIGATION_DIRECTORY_FOLLOWERS" }); + } + }} /> - {/* {this.state.tab === 0 ? ( + {/* {this.props.tab === 0 ? ( requests && requests.length ? ( requests ) : ( @@ -489,7 +494,7 @@ export default class SceneDirectory extends React.Component { ) ) : null} - {this.state.tab === 1 ? ( + {this.props.tab === 1 ? ( trusted && trusted.length ? ( trusted ) : ( @@ -499,7 +504,7 @@ export default class SceneDirectory extends React.Component { ) ) : null} */} - {this.state.tab === 0 ? ( + {this.props.tab === 0 ? ( following && following.length ? ( following ) : ( @@ -509,7 +514,7 @@ export default class SceneDirectory extends React.Component { ) ) : null} - {this.state.tab === 1 ? ( + {this.props.tab === 1 ? ( followers && followers.length ? ( followers ) : ( diff --git a/scenes/SceneSlate.js b/scenes/SceneSlate.js index e0ecb81f..0004dbb6 100644 --- a/scenes/SceneSlate.js +++ b/scenes/SceneSlate.js @@ -240,9 +240,9 @@ export default class SceneSlate extends React.Component {
{this.state.isFollowing ? ( - Unfollow + Unfollow ) : ( - Follow + Follow )}
{ this.props.onAction({ name: "Create slate", @@ -60,8 +56,17 @@ export default class SceneSlates extends React.Component { actions={ this.setState({ tab: value })} + value={this.props.tab} + onChange={(value) => { + if (value === 0) { + this.props.onAction({ type: "NAVIGATE", value: "V1_NAVIGATION_SLATES" }); + } else { + this.props.onAction({ + type: "NAVIGATE", + value: "V1_NAVIGATION_SLATES_FOLLOWING", + }); + } + }} style={{ margin: "0 0 24px 0" }} /> } @@ -69,7 +74,7 @@ export default class SceneSlates extends React.Component { {/* @@ -77,7 +82,7 @@ export default class SceneSlates extends React.Component { } /> */} - {this.state.tab === 0 ? ( + {this.props.tab === 0 ? ( this.props.viewer.slates && this.props.viewer.slates.length ? (