diff --git a/pkg/interface/src/views/apps/publish/components/Note.tsx b/pkg/interface/src/views/apps/publish/components/Note.tsx index ef2906be4f..5aeae4d99e 100644 --- a/pkg/interface/src/views/apps/publish/components/Note.tsx +++ b/pkg/interface/src/views/apps/publish/components/Note.tsx @@ -13,7 +13,7 @@ import { roleForShip } from '~/logic/lib/group'; import Author from '~/views/components/Author'; import { Contacts, GraphNode, Graph, Association, Unreads, Group } from '@urbit/api'; import {useCopy} from '~/logic/lib/useCopy'; -import {usePermalinkForGraph, getPermalinkForGraph} from '~/logic/lib/permalinks'; +import { getPermalinkForGraph } from '~/logic/lib/permalinks'; import {useQuery} from '~/logic/lib/useQuery'; interface NoteProps { diff --git a/pkg/interface/src/views/landscape/components/Home/GroupFeed.js b/pkg/interface/src/views/landscape/components/Home/GroupFeed.js index 666e79ad7d..3cc67e939e 100644 --- a/pkg/interface/src/views/landscape/components/Home/GroupFeed.js +++ b/pkg/interface/src/views/landscape/components/Home/GroupFeed.js @@ -27,6 +27,7 @@ export function GroupFeed(props) { ).length; const relativePath = (path) => baseUrl + path; + const association = associations.graph[graphPath]; useEffect(() => { // TODO: VirtualScroller should support lower starting values than 100 @@ -53,6 +54,7 @@ export function GroupFeed(props) { return ( @@ -64,6 +66,7 @@ export function GroupFeed(props) { return ( diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostFeed.js b/pkg/interface/src/views/landscape/components/Home/Post/PostFeed.js index 754a7c0c7d..8f98115245 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostFeed.js +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostFeed.js @@ -23,7 +23,8 @@ export class PostFeed extends React.Component { api, history, baseUrl, - parentNode + parentNode, + association } = this.props; const node = graph.get(index); if (!node) { return null; } @@ -53,6 +54,7 @@ export class PostFeed extends React.Component { node={parentNode} contacts={contacts} graphResource={graphResource} + association={association} api={api} index={nodeIndex} baseUrl={baseUrl} @@ -65,6 +67,7 @@ export class PostFeed extends React.Component { node={node} contacts={contacts} graphResource={graphResource} + association={association} api={api} index={[...nodeIndex, index]} baseUrl={baseUrl} @@ -83,6 +86,7 @@ export class PostFeed extends React.Component { node={node} contacts={contacts} graphResource={graphResource} + association={association} api={api} index={[index]} baseUrl={baseUrl} diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostHeader.js b/pkg/interface/src/views/landscape/components/Home/Post/PostHeader.js index 4fa2c07289..19592b52e5 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostHeader.js +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostHeader.js @@ -1,14 +1,30 @@ import React from 'react'; -import { Row, Icon } from '@tlon/indigo-react'; +import { Col, Row, Icon, Action } from '@tlon/indigo-react'; import Author from '~/views/components/Author'; +import { useCopy } from '~/logic/lib/useCopy'; +import { getPermalinkForGraph } from '~/logic/lib/permalinks'; +import { Dropdown } from '~/views/components/Dropdown'; + export function PostHeader(props) { - const { post, contacts, api, isReply } = props; + const { post, contacts, api, association, isReply } = props; const mb = isReply ? "2" : "3"; + const permalink = !!association ? getPermalinkForGraph( + association.group, + association.resource, + post.index + ) : ''; + const { copyDisplay, doCopy } = useCopy(permalink, 'Copy Link'); + return ( - + { e.stopPropagation(); }}> - + + + + {copyDisplay} + + + + }> + + ); } diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostItem.js b/pkg/interface/src/views/landscape/components/Home/Post/PostItem.js index 18796a692c..46179212e4 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostItem.js +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostItem.js @@ -46,6 +46,7 @@ class PostItem extends React.Component { contacts, api, graphResource, + association, index, innerRef, isParent, @@ -82,7 +83,12 @@ class PostItem extends React.Component { onClick={this.navigateToReplies} cursor={isParent ? "default": "pointer"} {...bind}> - + { isReply ? ( Replying to diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostReplies.js b/pkg/interface/src/views/landscape/components/Home/Post/PostReplies.js index 31a7aa62aa..08a15cd13d 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostReplies.js +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostReplies.js @@ -12,7 +12,7 @@ export function PostReplies(props) { baseUrl, api, history, - associations, + association, groups, contacts, graphPath, @@ -68,6 +68,7 @@ export function PostReplies(props) { node={node} contacts={contacts} graphResource={graphResource} + association={association} api={api} index={nodeIndex} baseUrl={baseUrl} @@ -99,7 +100,7 @@ export function PostReplies(props) { graph={graph} parentNode={node} pendingSize={pendingSize} - associations={associations} + association={association} groups={groups} contacts={contacts} api={api} diff --git a/pkg/interface/src/views/landscape/components/Home/Post/PostTimeline.js b/pkg/interface/src/views/landscape/components/Home/Post/PostTimeline.js index b26a0bf47c..e77dcbeafd 100644 --- a/pkg/interface/src/views/landscape/components/Home/Post/PostTimeline.js +++ b/pkg/interface/src/views/landscape/components/Home/Post/PostTimeline.js @@ -10,7 +10,7 @@ export function PostTimeline(props) { baseUrl, api, history, - associations, + association, groups, contacts, graphPath, @@ -85,7 +85,7 @@ export function PostTimeline(props) { graphResource={graphResource} graph={graphs[graphId]} pendingSize={pendingSize} - associations={associations} + association={association} groups={groups} contacts={contacts} api={api}