diff --git a/pkg/interface/src/views/apps/links/app.js b/pkg/interface/src/views/apps/links/app.js index baa7629d8..e184aa7c0 100644 --- a/pkg/interface/src/views/apps/links/app.js +++ b/pkg/interface/src/views/apps/links/app.js @@ -7,7 +7,6 @@ import './css/custom.css'; import { Skeleton } from './components/skeleton'; import { NewScreen } from './components/new'; -import { MemberScreen } from './components/member'; import { SettingsScreen } from './components/settings'; import { MessageScreen } from './components/lib/message-screen'; import { Links } from './components/links-list'; @@ -18,7 +17,6 @@ import { base64urlDecode } from '../../../logic/lib/util'; - export class LinksApp extends Component { constructor(props) { super(props); @@ -41,7 +39,6 @@ export class LinksApp extends Component { this.props.subscription.stopApp('link'); } - render() { const { props } = this; @@ -69,7 +66,6 @@ export class LinksApp extends Component { const invites = props.invites ? props.invites : {}; - const listening = props.linkListening; const { api, sidebarShown } = this.props; @@ -133,46 +129,6 @@ export class LinksApp extends Component { 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/'); @@ -283,11 +239,8 @@ export class LinksApp extends Component { 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 data = links?.[resourcePath]?.[page]?.[index] || {}; + const coms = !comments[resourcePath] ? undefined : comments[resourcePath][url]; diff --git a/pkg/interface/src/views/apps/links/components/lib/invite-element.js b/pkg/interface/src/views/apps/links/components/lib/invite-element.js deleted file mode 100644 index 94da5d575..000000000 --- a/pkg/interface/src/views/apps/links/components/lib/invite-element.js +++ /dev/null @@ -1,78 +0,0 @@ -import React, { Component } from 'react'; -import { InviteSearch } from '../../../../components/InviteSearch'; -import { Spinner } from '../../../../components/Spinner'; - -export class InviteElement extends Component { - constructor(props) { - super(props); - this.state = { - members: [], - error: false, - success: false, - awaiting: false - }; - this.setInvite = this.setInvite.bind(this); - } - - modifyMembers() { - const { props, state } = this; - - const aud = state.members.map(mem => `~${mem}`); - - if (state.members.length === 0) { - this.setState({ - error: true, - success: false - }); - return; - } - - this.setState({ awaiting: true }); - - this.setState({ - error: false, - success: true, - members: [] - }, () => { - props.api.links.inviteToCollection(props.resourcePath, aud).then(() => { - this.setState({ awaiting: false }); - }); - }); - } - - setInvite(invite) { - this.setState({ members: invite.ships }); - } - - render() { - const { props, state } = this; - - let modifyButtonClasses = 'mt4 db f9 ba pa2 white-d bg-gray0-d b--black b--gray2-d pointer'; - if (state.error) { - modifyButtonClasses = modifyButtonClasses + ' gray3'; - } - - return ( -
- - - -
- ); - } -} diff --git a/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js b/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js index 31ed9833c..9c46ffc91 100644 --- a/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js +++ b/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js @@ -6,17 +6,11 @@ export class LinksTabBar extends Component { render() { const props = this.props; - let memColor = '', - setColor = ''; + let setColor = ''; if (props.location.pathname.includes('/settings')) { - memColor = 'gray3'; setColor = 'black white-d'; - } else if (props.location.pathname.includes('/members')) { - memColor = 'black white-d'; - setColor = 'gray3'; } else { - memColor = 'gray3'; setColor = 'gray3'; } @@ -26,18 +20,6 @@ export class LinksTabBar extends Component { return (
- {props.amOwner ? ( -
- - Members - -
- ) : ( -
- )}
; - } - - return ( -
-
- {'⟵ All Collections'} -
-
- - -

- {props.resource.metadata.title} -

- - -
-
- -
-
- ); - } -}