From d372da3829908998f581e85bdd4e8c1f696eb174 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 13 Aug 2020 23:25:50 +0000 Subject: [PATCH 1/5] dojo: reintroduce "??? expr" parse debug mode NOTE does a somewhat quetionable type thing, original version didn't compile --- pkg/arvo/app/dojo.hoon | 51 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index ffd205c3e..dca94bdf1 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -502,8 +502,8 @@ ^+ +> :: XX needs filter :: - :: ?: ?=({$show $3} -.mad) - :: (dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command + ?: ?=({$show $3} -.mad) + (dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command ?: ?=($brev -.mad) =. var (~(del by var) p.mad) =< dy-amok @@ -592,7 +592,7 @@ :: XX actually print something meaningful here :: %2 [[%rose [~ " " ~] *tank ~] maar] - %3 ~ + ::%3 handled above %4 ~ %5 [[%rose [~ " " ~] (xskol p.q.cay) ~] maar] == @@ -638,6 +638,49 @@ :- i="" t=(turn `wain`?~(r.hit ~ (to-wain:format q.u.r.hit)) trip) == + :: + :: XX needs filter + :: + ++ dy-shown + =/ jank-bucwut :: FIXME just $? fishes when defined for some reason + |* [a=mold b=mold] + |=(c=_`*`*a ?:(& (a c) (b c))) + :: + ::$? hoon + ;: jank-bucwut + hoon + $^ {dy-shown dy-shown} + $% {$ur cord} + {$sa mark} + {$as mark dy-shown} + {$do hoon dy-shown} + {$ge path (list dy-shown) (map term (unit dy-shown))} + {$dv path} + == + == + :: + ++ dy-show-source + |= a/dojo-source ^- tank + =- >[-]< + =+ `{@ bil/dojo-build}`a + |- ^- dy-shown + ::?- -.bil + ?+ -.bil dv+/[-.bil]/todo + $?($ur $dv $sa) bil + $ex ?. ?=({$cltr *} p.bil) p.bil + |- ^- hoon + ?~ p.p.bil !! + ?~ t.p.p.bil i.p.p.bil + [i.p.p.bil $(p.p.bil t.p.p.bil)] + $tu ?~ p.bil !! + |- + ?~ t.p.bil ^$(bil q.i.p.bil) + [^$(bil q.i.p.bil) $(p.bil t.p.bil)] + $as bil(q $(bil q.q.bil)) + $do bil(q $(bil q.q.bil)) + $ge :+ %ge q.p.p.bil + [(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))] + == :: ++ dy-edit :: handle edit |= cal/sole-change @@ -875,6 +918,8 @@ ?> ?=(~ cud) ?: =(nex num) dy-over + ?: =([%show %3] -.mad) :: just show source + dy-over dy-make(cud `[nex (~(got by job) nex)]) -- :: From dda386472c36ae92b35356ef4aed4b1582d52a09 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 13 Aug 2020 23:40:20 +0000 Subject: [PATCH 2/5] dojo ???: handle threads --- pkg/arvo/app/dojo.hoon | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index dca94bdf1..f154e232a 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -503,7 +503,7 @@ :: XX needs filter :: ?: ?=({$show $3} -.mad) - (dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command + (dy-rash %tan (dy-show-source q.mad) ~) ?: ?=($brev -.mad) =. var (~(del by var) p.mad) =< dy-amok @@ -654,6 +654,7 @@ {$sa mark} {$as mark dy-shown} {$do hoon dy-shown} + {$te term (list dy-shown)} {$ge path (list dy-shown) (map term (unit dy-shown))} {$dv path} == @@ -664,8 +665,7 @@ =- >[-]< =+ `{@ bil/dojo-build}`a |- ^- dy-shown - ::?- -.bil - ?+ -.bil dv+/[-.bil]/todo + ?- -.bil $?($ur $dv $sa) bil $ex ?. ?=({$cltr *} p.bil) p.bil |- ^- hoon @@ -678,6 +678,7 @@ [^$(bil q.i.p.bil) $(p.bil t.p.bil)] $as bil(q $(bil q.q.bil)) $do bil(q $(bil q.q.bil)) + $te bil(q (turn q.bil ..$)) $ge :+ %ge q.p.p.bil [(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))] == From 4c45ffc7f02fb3e899b7188725bb26abfb4f7f94 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 14 Aug 2020 00:03:53 +0000 Subject: [PATCH 3/5] dojo: reintroduce "?? expr" raw-ish type printer --- pkg/arvo/app/dojo.hoon | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index f154e232a..7f3bffafa 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -589,9 +589,7 @@ ?- p.p.mad %0 ~ %1 [[%rose [~ " " ~] (skol p.q.cay) ~] maar] - :: XX actually print something meaningful here - :: - %2 [[%rose [~ " " ~] *tank ~] maar] + %2 [[%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~] maar] ::%3 handled above %4 ~ %5 [[%rose [~ " " ~] (xskol p.q.cay) ~] maar] @@ -638,6 +636,26 @@ :- i="" t=(turn `wain`?~(r.hit ~ (to-wain:format q.u.r.hit)) trip) == + ++ dy-show-type-noun + |= a/type ^- tank + =- >[-]< + |- ^- $? $% {$atom @tas (unit @)} + {$cell _$ _$} + {$face $@(term tune) _$} + {$fork (set _$)} + {$hold _$ hoon} + == + wain :: "<|core|>" + $?($noun $void) + == + ?+ a a + {$face ^} a(q $(a q.a)) + {$cell ^} a(p $(a p.a), q $(a q.a)) + {$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b))))) + {$hint *} !! + {$core ^} `wain`/core + {$hold *} a(p $(a p.a)) + == :: :: XX needs filter :: From 3ad6c953298e32041044ca9df9269660f7169cbf Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Thu, 13 Aug 2020 21:07:53 -0700 Subject: [PATCH 4/5] interface: made head reactive --- pkg/interface/package-lock.json | 23 + pkg/interface/package.json | 1 + pkg/interface/src/views/App.js | 43 +- pkg/interface/src/views/apps/chat/app.tsx | 389 +++++++++-------- pkg/interface/src/views/apps/dojo/app.js | 102 ++--- pkg/interface/src/views/apps/groups/app.tsx | 7 +- pkg/interface/src/views/apps/launch/app.js | 33 +- pkg/interface/src/views/apps/links/app.js | 433 +++++++++---------- pkg/interface/src/views/apps/publish/app.tsx | 180 ++++---- 9 files changed, 624 insertions(+), 587 deletions(-) diff --git a/pkg/interface/package-lock.json b/pkg/interface/package-lock.json index 69aa44f12..fde20811e 100644 --- a/pkg/interface/package-lock.json +++ b/pkg/interface/package-lock.json @@ -7700,6 +7700,24 @@ "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" }, + "react-helmet": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz", + "integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==", + "requires": { + "object-assign": "^4.1.1", + "prop-types": "^15.7.2", + "react-fast-compare": "^3.1.1", + "react-side-effect": "^2.1.0" + }, + "dependencies": { + "react-fast-compare": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", + "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" + } + } + }, "react-hot-loader": { "version": "4.12.21", "resolved": "https://registry.npmjs.org/react-hot-loader/-/react-hot-loader-4.12.21.tgz", @@ -7781,6 +7799,11 @@ "tiny-warning": "^1.0.0" } }, + "react-side-effect": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.0.tgz", + "integrity": "sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==" + }, "react-window": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.5.tgz", diff --git a/pkg/interface/package.json b/pkg/interface/package.json index 6e24d48c7..f670bb58e 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -23,6 +23,7 @@ "react": "^16.5.2", "react-codemirror2": "^6.0.1", "react-dom": "^16.8.6", + "react-helmet": "^6.1.0", "react-markdown": "^4.3.1", "react-router-dom": "^5.0.0", "react-window": "^1.8.5", diff --git a/pkg/interface/src/views/App.js b/pkg/interface/src/views/App.js index dbe6cc88a..a81901e4c 100644 --- a/pkg/interface/src/views/App.js +++ b/pkg/interface/src/views/App.js @@ -4,6 +4,7 @@ import * as React from 'react'; import { BrowserRouter as Router, Route, withRouter, Switch } from 'react-router-dom'; import styled, { ThemeProvider, createGlobalStyle } from 'styled-components'; import { sigil as sigiljs, stringRenderer } from 'urbit-sigil-js'; +import Helmet from 'react-helmet'; import Mousetrap from 'mousetrap'; import 'mousetrap-global-bind'; @@ -50,7 +51,7 @@ class App extends React.Component { new GlobalSubscription(this.store, this.api, this.appChannel); this.updateTheme = this.updateTheme.bind(this); - this.setFavicon = this.setFavicon.bind(this); + this.faviconString = this.faviconString.bind(this); } componentDidMount() { @@ -64,39 +65,30 @@ class App extends React.Component { e.stopImmediatePropagation(); this.api.local.setOmnibox(); }); - this.setFavicon(); } componentWillUnmount() { this.themeWatcher.removeListener(this.updateTheme); } - componentDidUpdate(prevProps, prevState, snapshot) { - this.setFavicon(); - } - updateTheme(e) { this.api.local.setDark(e.matches); } - setFavicon() { - if (window.ship.length < 14) { - let background = '#ffffff'; - if (this.state.contacts.hasOwnProperty('/~/default')) { - background = `#${uxToHex(this.state.contacts['/~/default'][window.ship].color)}`; - } - const foreground = foregroundFromBackground(background); - const svg = sigiljs({ - patp: window.ship, - renderer: stringRenderer, - size: 16, - colors: [background, foreground] - }); - const dataurl = 'data:image/svg+xml;base64,' + btoa(svg); - const favicon = document.querySelector('[rel=icon]'); - favicon.href = dataurl; - favicon.type = 'image/svg+xml'; + faviconString() { + let background = '#ffffff'; + if (this.state.contacts.hasOwnProperty('/~/default')) { + background = `#${uxToHex(this.state.contacts['/~/default'][window.ship].color)}`; } + const foreground = foregroundFromBackground(background); + const svg = sigiljs({ + patp: window.ship, + renderer: stringRenderer, + size: 16, + colors: [background, foreground] + }); + const dataurl = 'data:image/svg+xml;base64,' + btoa(svg); + return dataurl; } render() { @@ -107,6 +99,11 @@ class App extends React.Component { return ( + + {window.ship.length < 14 + ? + : null} + { - totalUnreads = 0; - constructor(props) { super(props); } componentDidMount() { - document.title = 'OS1 - Chat'; // preload spinner asset new Image().src = '/~landscape/img/Spinner.png'; @@ -79,12 +77,6 @@ export default class ChatApp extends React.Component { } }); - if (totalUnreads !== this.totalUnreads) { - document.title = - totalUnreads > 0 ? `(${totalUnreads}) OS1 - Chat` : 'OS1 - Chat'; - this.totalUnreads = totalUnreads; - } - const { invites, s3, @@ -113,208 +105,213 @@ export default class ChatApp extends React.Component { ); return ( - - { - return ( - -
-
-

- Select, create, or join a chat to begin. -

+ <> + + {totalUnreads > 0 ? `(${totalUnreads}) ` : ''}OS1 - Chat + + + { + return ( + +
+
+

+ Select, create, or join a chat to begin. +

+
-
- - ); - }} - /> - { - const ship = props.match.params.ship; + + ); + }} + /> + { + const ship = props.match.params.ship; - return ( - - - - ); - }} - /> - { - return ( - - - - ); - }} - /> - { - let station = `/${props.match.params.ship}/${props.match.params.station}`; + return ( + + + + ); + }} + /> + { + return ( + + + + ); + }} + /> + { + let station = `/${props.match.params.ship}/${props.match.params.station}`; - return ( - - - - ); - }} - /> - { - let station = `/${props.match.params.ship}/${props.match.params.station}`; - const mailbox = inbox[station] || { - config: { - read: 0, - length: 0 - }, - envelopes: [] - }; + return ( + + + + ); + }} + /> + { + let station = `/${props.match.params.ship}/${props.match.params.station}`; + const mailbox = inbox[station] || { + config: { + read: 0, + length: 0 + }, + envelopes: [] + }; - let roomContacts = {}; - const associatedGroup = - station in associations['chat'] && - 'group-path' in associations.chat[station] - ? associations.chat[station]['group-path'] - : ''; + let roomContacts = {}; + const associatedGroup = + station in associations['chat'] && + 'group-path' in associations.chat[station] + ? associations.chat[station]['group-path'] + : ''; - if (associations.chat[station] && associatedGroup in contacts) { - roomContacts = contacts[associatedGroup]; - } + if (associations.chat[station] && associatedGroup in contacts) { + roomContacts = contacts[associatedGroup]; + } - const association = - station in associations['chat'] ? associations.chat[station] : {}; + const association = + station in associations['chat'] ? associations.chat[station] : {}; - const group = groups[association['group-path']] || groupBunts.group(); + const group = groups[association['group-path']] || groupBunts.group(); - const popout = props.match.url.includes('/popout/'); + const popout = props.match.url.includes('/popout/'); - return ( - - - - ); - }} - /> - { - let station = `/${props.match.params.ship}/${props.match.params.station}`; - const popout = props.match.url.includes('/popout/'); + sidebar={renderChannelSidebar(props, station)} + > + + + ); + }} + /> + { + let station = `/${props.match.params.ship}/${props.match.params.station}`; + const popout = props.match.url.includes('/popout/'); - const association = - station in associations['chat'] ? associations.chat[station] : {}; - const group = groups[association['group-path']] || groupBunts.group(); + const association = + station in associations['chat'] ? associations.chat[station] : {}; + const group = groups[association['group-path']] || groupBunts.group(); - return ( - - - - ); - }} - /> - + sidebar={renderChannelSidebar(props, station)} + > + + + ); + }} + /> + + ); } } diff --git a/pkg/interface/src/views/apps/dojo/app.js b/pkg/interface/src/views/apps/dojo/app.js index cfaffd6e6..689194f61 100644 --- a/pkg/interface/src/views/apps/dojo/app.js +++ b/pkg/interface/src/views/apps/dojo/app.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Route, Link } from 'react-router-dom'; import classnames from 'classnames'; +import Helmet from 'react-helmet'; import { Popout } from './components/lib/icons/popout'; import { History } from './components/history'; @@ -28,8 +29,6 @@ export default class DojoApp extends Component { } componentDidMount() { - document.title = 'OS1 - Dojo'; - const channel = new window.channel(); this.api = new Api(this.props.ship, channel); this.store.api = this.api; @@ -46,56 +45,61 @@ export default class DojoApp extends Component { render() { return ( -
- { - const popout = Boolean(props.match.params.popout); + <> + + OS1 - Dojo + +
+ { + const popout = Boolean(props.match.params.popout); - const popoutClasses = classnames({ - 'mh4-m mh4-l mh4-xl': !popout, - 'mb4-m mb4-l mb4-xl': !popout, - 'ba-m ba-l ba-xl': !popout - }); + const popoutClasses = classnames({ + 'mh4-m mh4-l mh4-xl': !popout, + 'mb4-m mb4-l mb4-xl': !popout, + 'ba-m ba-l ba-xl': !popout + }); - return ( -
-
+ return ( +
+
+
+
+ + + +
-
- - - -
-
- ); - }} - /> -
+ ); + }} + /> +
+ ); } } diff --git a/pkg/interface/src/views/apps/groups/app.tsx b/pkg/interface/src/views/apps/groups/app.tsx index 5e73f024b..2f6423d75 100644 --- a/pkg/interface/src/views/apps/groups/app.tsx +++ b/pkg/interface/src/views/apps/groups/app.tsx @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { Route, Switch } from 'react-router-dom'; +import Helmet from 'react-helmet'; import './css/custom.css'; @@ -25,7 +26,6 @@ type GroupsAppProps = StoreState & { export default class GroupsApp extends Component { componentDidMount() { - document.title = 'OS1 - Groups'; // preload spinner asset new Image().src = '/~landscape/img/Spinner.png'; @@ -55,6 +55,10 @@ export default class GroupsApp extends Component { return ( + <> + + OS1 - Groups + { @@ -357,6 +361,7 @@ export default class GroupsApp extends Component { }} /> + ); } } diff --git a/pkg/interface/src/views/apps/launch/app.js b/pkg/interface/src/views/apps/launch/app.js index 6c410f378..19084a3ca 100644 --- a/pkg/interface/src/views/apps/launch/app.js +++ b/pkg/interface/src/views/apps/launch/app.js @@ -1,4 +1,5 @@ import React from 'react'; +import Helmet from 'react-helmet'; import './css/custom.css'; @@ -8,7 +9,6 @@ import Welcome from './components/welcome'; export default class LaunchApp extends React.Component { componentDidMount() { - document.title = 'OS1 - Home'; // preload spinner asset new Image().src = '/~landscape/img/Spinner.png'; @@ -18,19 +18,24 @@ export default class LaunchApp extends React.Component { const { props } = this; return ( -
-
- - -
-
{props.baseHash}
-
+ <> + + OS1 - Home + +
+
+ + +
+
{props.baseHash}
+
+ ); } } diff --git a/pkg/interface/src/views/apps/links/app.js b/pkg/interface/src/views/apps/links/app.js index 983b15b67..a785564bd 100644 --- a/pkg/interface/src/views/apps/links/app.js +++ b/pkg/interface/src/views/apps/links/app.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { Switch, Route } from 'react-router-dom'; +import Helmet from 'react-helmet'; import _ from 'lodash'; @@ -22,11 +23,9 @@ import { export class LinksApp extends Component { constructor(props) { super(props); - this.totalUnseen = 0; } componentDidMount() { - document.title = 'OS1 - Links'; // preload spinner asset new Image().src = '/~landscape/img/Spinner.png'; @@ -61,11 +60,6 @@ export class LinksApp extends Component { 0 ); - if(totalUnseen !== this.totalUnseen) { - document.title = totalUnseen !== 0 ? `(${totalUnseen}) OS1 - Links` : 'OS1 - Links'; - this.totalUnseen = totalUnseen; - } - const invites = props.invites ? props.invites : {}; @@ -75,167 +69,77 @@ export class LinksApp extends Component { const { api, sidebarShown } = this.props; return ( - - { - return ( - - - - ); - }} - /> - { - return ( - - - - ); - }} - /> - { - const resourcePath = '/' + props.match.params.resource; - - const autoJoin = () => { - try { - api.links.joinCollection(resourcePath); - props.history.push(makeRoutePath(resourcePath)); - } catch(err) { - setTimeout(autoJoin, 2000); - } - }; - autoJoin(); - }} - /> - { - const popout = props.match.url.includes('/popout/'); - const resourcePath = '/' + props.match.params.resource; - const resource = associations.link[resourcePath] || { metadata: {} }; - - const contactDetails = contacts[resource['group-path']] || {}; - const group = groups[resource['group-path']] || new Set([]); - const amOwner = amOwnerOfGroup(resource['group-path']); - - return ( - - - - ); - }} - /> - { - const popout = props.match.url.includes('/popout/'); - const resourcePath = '/' + props.match.params.resource; - const resource = associations.link[resourcePath] || false; - - const contactDetails = contacts[resource['group-path']] || {}; - const group = groups[resource['group-path']] || new Set([]); - const amOwner = amOwnerOfGroup(resource['group-path']); - - return ( - - - - ); - }} - /> - + + {totalUnseen > 0 ? `(${totalUnseen}) ` : ''}OS1 - Links + + + { + return ( + + + + ); + }} + /> + { + return ( + + + + ); + }} + /> + { + const resourcePath = '/' + props.match.params.resource; + + const autoJoin = () => { + try { + api.links.joinCollection(resourcePath); + props.history.push(makeRoutePath(resourcePath)); + } catch(err) { + setTimeout(autoJoin, 2000); + } + }; + autoJoin(); + }} + /> + { + const popout = props.match.url.includes('/popout/'); const resourcePath = '/' + props.match.params.resource; const resource = associations.link[resourcePath] || { metadata: {} }; - const amOwner = amOwnerOfGroup(resource['group-path']); - const contactDetails = contacts[resource['group-path']] || {}; - - const page = props.match.params.page || 0; - - const popout = props.match.url.includes('/popout/'); - - const channelLinks = links[resourcePath] - ? links[resourcePath] - : { local: {} }; - - const channelComments = comments[resourcePath] - ? comments[resourcePath] - : {}; - - const channelSeen = seen[resourcePath] - ? seen[resourcePath] - : {}; + const group = groups[resource['group-path']] || new Set([]); + const amOwner = amOwnerOfGroup(resource['group-path']); return ( - ); }} /> - { - const resourcePath = '/' + props.match.params.resource; - const resource = associations.link[resourcePath] || { metadata: {} }; - - const amOwner = amOwnerOfGroup(resource['group-path']); - const popout = props.match.url.includes('/popout/'); + const resourcePath = '/' + props.match.params.resource; + const resource = associations.link[resourcePath] || false; const contactDetails = contacts[resource['group-path']] || {}; - - const index = props.match.params.index || 0; - const page = props.match.params.page || 0; - const url = base64urlDecode(props.match.params.encodedUrl); - - const data = links[resourcePath] - ? links[resourcePath][page] - ? links[resourcePath][page][index] - : {} - : {}; - const coms = !comments[resourcePath] - ? undefined - : comments[resourcePath][url]; - - const commentPage = props.match.params.commentpage || 0; + const group = groups[resource['group-path']] || new Set([]); + const amOwner = amOwnerOfGroup(resource['group-path']); return ( - ); }} /> - + { + const resourcePath = '/' + props.match.params.resource; + const resource = associations.link[resourcePath] || { metadata: {} }; + + const amOwner = amOwnerOfGroup(resource['group-path']); + + const contactDetails = contacts[resource['group-path']] || {}; + + const page = props.match.params.page || 0; + + const popout = props.match.url.includes('/popout/'); + + const channelLinks = links[resourcePath] + ? links[resourcePath] + : { local: {} }; + + const channelComments = comments[resourcePath] + ? comments[resourcePath] + : {}; + + const channelSeen = seen[resourcePath] + ? seen[resourcePath] + : {}; + + return ( + + + + ); + }} + /> + { + const resourcePath = '/' + props.match.params.resource; + const resource = associations.link[resourcePath] || { metadata: {} }; + + const amOwner = amOwnerOfGroup(resource['group-path']); + + const popout = props.match.url.includes('/popout/'); + + const contactDetails = contacts[resource['group-path']] || {}; + + const index = props.match.params.index || 0; + const page = props.match.params.page || 0; + const url = base64urlDecode(props.match.params.encodedUrl); + + const data = links[resourcePath] + ? links[resourcePath][page] + ? links[resourcePath][page][index] + : {} + : {}; + const coms = !comments[resourcePath] + ? undefined + : comments[resourcePath][url]; + + const commentPage = props.match.params.commentpage || 0; + + return ( + + + + ); + }} + /> + + ); } } diff --git a/pkg/interface/src/views/apps/publish/app.tsx b/pkg/interface/src/views/apps/publish/app.tsx index b0ccab99b..384b1e1da 100644 --- a/pkg/interface/src/views/apps/publish/app.tsx +++ b/pkg/interface/src/views/apps/publish/app.tsx @@ -2,6 +2,7 @@ import React, { useRef, useEffect } from "react"; import { Route, Switch, useLocation, withRouter } from "react-router-dom"; import { Center, Text } from "@tlon/indigo-react"; import _ from "lodash"; +import Helmet from 'react-helmet'; import "./css/custom.css"; @@ -61,99 +62,104 @@ export default function PublishApp(props: PublishAppProps) { : "rightPanel"; return ( - - + + {unreadTotal > 0 ? `(${unreadTotal}) ` : ''}OS1 - Publish + + - - -
- - Select or create a notebook to begin. - -
-
- { - return ( - - ); - }} - /> - { - const ship = props.match.params.ship || ""; - const notebook = props.match.params.notebook || ""; - return ( - - ); - }} - /> - { - const view = props.match.params.view - ? props.match.params.view - : "posts"; - - - const ship = props.match.params.ship || ""; - const book = props.match.params.notebook || ""; - - const bookGroupPath = - notebooks?.[ship]?.[book]?.["subscribers-group-path"]; - - const notebookContacts = - bookGroupPath in contacts ? contacts[bookGroupPath] : {}; - - const notebook = notebooks?.[ship]?.[book]; + + + +
+ + Select or create a notebook to begin. + +
+
+ { return ( - + ); + }} + /> + { + const ship = props.match.params.ship || ""; + const notebook = props.match.params.notebook || ""; + return ( + ); - }} - /> -
-
-
+ }} + /> + { + const view = props.match.params.view + ? props.match.params.view + : "posts"; + + + const ship = props.match.params.ship || ""; + const book = props.match.params.notebook || ""; + + const bookGroupPath = + notebooks?.[ship]?.[book]?.["subscribers-group-path"]; + + const notebookContacts = + bookGroupPath in contacts ? contacts[bookGroupPath] : {}; + + const notebook = notebooks?.[ship]?.[book]; + return ( + + ); + }} + /> +
+
+
+ ); } From 46af34cfe88a0466b00f16550d3ee6e21902f642 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 25 Aug 2020 13:45:32 -0700 Subject: [PATCH 5/5] dojo: fix dy-show-type-noun indent --- pkg/arvo/app/dojo.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index 7f3bffafa..da42334f2 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -636,8 +636,8 @@ :- i="" t=(turn `wain`?~(r.hit ~ (to-wain:format q.u.r.hit)) trip) == - ++ dy-show-type-noun - |= a/type ^- tank + ++ dy-show-type-noun + |= a/type ^- tank =- >[-]< |- ^- $? $% {$atom @tas (unit @)} {$cell _$ _$}