diff --git a/pkg/interface/publish/src/css/custom.css b/pkg/interface/publish/src/css/custom.css index 1ed3a9f1c6..1611a65a4a 100644 --- a/pkg/interface/publish/src/css/custom.css +++ b/pkg/interface/publish/src/css/custom.css @@ -96,7 +96,7 @@ a { .NewPost { width: 100%; - height: calc(100% - 103px); + height: calc(100% - 115px); display: flex; padding-top: 8px; } diff --git a/pkg/interface/publish/src/js/components/lib/about.js b/pkg/interface/publish/src/js/components/lib/about.js deleted file mode 100644 index cecb7de340..0000000000 --- a/pkg/interface/publish/src/js/components/lib/about.js +++ /dev/null @@ -1,16 +0,0 @@ -import React, { Component } from 'react'; - -//TODO "About" subcomponent of Notebook.js -//Fill in with "description" from props.notebook - -export class About extends Component { - render() { - return ( -

- -

- ) - } -} - -export default About diff --git a/pkg/interface/publish/src/js/components/lib/new-post.js b/pkg/interface/publish/src/js/components/lib/new-post.js index 3fd71b315a..ffb4109c85 100644 --- a/pkg/interface/publish/src/js/components/lib/new-post.js +++ b/pkg/interface/publish/src/js/components/lib/new-post.js @@ -46,8 +46,9 @@ export class NewPost extends Component { componentDidUpdate(prevProps, prevState) { let notebook = this.props.notebooks[this.props.ship][this.props.book]; if (notebook.notes[this.state.awaiting]) { + let popout = (this.props.popout) ? "popout/" : ""; let redirect = - `/~publish/note/${this.props.ship}/${this.props.book}/${this.state.awaiting}`; + `/~publish/${popout}note/${this.props.ship}/${this.props.book}/${this.state.awaiting}`; this.props.history.push(redirect); } } @@ -82,13 +83,12 @@ export class NewPost extends Component { ? { color: '#2AA779', cursor: "pointer" } : { color: '#B1B2B3', cursor: "auto" }; - let publishHrefIndex = props.location.pathname.indexOf("/notebook/"); - let publishsubStr = props.location.pathname.substr(publishHrefIndex) + let hrefIndex = props.location.pathname.indexOf("/notebook/"); + let publishsubStr = props.location.pathname.substr(hrefIndex) let popoutHref = `/~publish/popout${publishsubStr}`; let hiddenOnPopout = (props.popout) - ? "" - : "dib-m dib-l dib-xl" + ? "" : "dib-m dib-l dib-xl"; return (
diff --git a/pkg/interface/publish/src/js/components/lib/note-item.js b/pkg/interface/publish/src/js/components/lib/note-item.js deleted file mode 100644 index 59b039b383..0000000000 --- a/pkg/interface/publish/src/js/components/lib/note-item.js +++ /dev/null @@ -1,16 +0,0 @@ -import React, { Component } from 'react' - -//TODO render props from notebook.js as a div of individual notes in the -//notebook - -export class NoteItem extends Component { - render() { - return ( -
- -
- ) - } -} - -export default NoteItem diff --git a/pkg/interface/publish/src/js/components/lib/note-list.js b/pkg/interface/publish/src/js/components/lib/note-list.js deleted file mode 100644 index f8302a3243..0000000000 --- a/pkg/interface/publish/src/js/components/lib/note-list.js +++ /dev/null @@ -1,15 +0,0 @@ -import React, { Component } from 'react'; -import { NoteItem } from './note-item'; - -//TODO map a list of NoteItems -export class NoteList extends Component { - render() { - return ( -
- -
- ) - } -} - -export default NoteList diff --git a/pkg/interface/publish/src/js/components/lib/notebook-posts.js b/pkg/interface/publish/src/js/components/lib/notebook-posts.js index 5a78599283..c8490ca5bb 100644 --- a/pkg/interface/publish/src/js/components/lib/notebook-posts.js +++ b/pkg/interface/publish/src/js/components/lib/notebook-posts.js @@ -55,7 +55,8 @@ export class NotebookPosts extends Component { comment = `${note["num-comments"]} Comments`; } let date = moment(note["date-created"]).fromNow(); - let url = `/~publish/note/${props.host}/${props.notebookName}/${noteId}` + let popout = (props.popout) ? "popout/" : ""; + let url = `/~publish/${popout}note/${props.host}/${props.notebookName}/${noteId}` notes.push( diff --git a/pkg/interface/publish/src/js/components/lib/notebook.js b/pkg/interface/publish/src/js/components/lib/notebook.js index d0dd65d64a..26934488bf 100644 --- a/pkg/interface/publish/src/js/components/lib/notebook.js +++ b/pkg/interface/publish/src/js/components/lib/notebook.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { Link, Switch, Route } from 'react-router-dom'; -import { NoteList } from './note-list'; +import { SidebarSwitcher } from './icons/icon-sidebar-switch'; import { NotebookPosts } from './notebook-posts'; -import { About } from './about'; import { Subscribers } from './subscribers'; import { Settings } from './settings'; +import Sidebar from './sidebar'; //TODO subcomponent logic for subscribers, settings @@ -71,6 +71,13 @@ export class Notebook extends Component { render() { const { props } = this; + // popout logic + let hrefIndex = props.location.pathname.indexOf("/notebook/"); + let publishsubStr = props.location.pathname.substr(hrefIndex); + let popoutHref = `/~publish/popout${publishsubStr}`; + + let hiddenOnPopout = props.popout ? "" : "dib-m dib-l dib-xl"; + let notebook = props.notebooks[props.ship][props.book]; let tabStyles = { @@ -87,6 +94,7 @@ export class Notebook extends Component { let notesList = notebook["notes-by-date"] || []; let notes = notebook.notes || null; inner = + + + +
{notebook.title}
by - + {name} diff --git a/pkg/interface/publish/src/js/components/root.js b/pkg/interface/publish/src/js/components/root.js index 701a185c7c..b475805697 100644 --- a/pkg/interface/publish/src/js/components/root.js +++ b/pkg/interface/publish/src/js/components/root.js @@ -126,7 +126,7 @@ export class Root extends Component { else { return ( -
{props.children}