2 lines
5.2 KiB
JavaScript
2 lines
5.2 KiB
JavaScript
"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[1047],{4589:function(e,t,n){n.r(t),n.d(t,{SinglePostView:function(){return d},default:function(){return g}});var a=n(45793),r=n(94159),o=n(18196),l=n(71860),c=n(62745),m=n(90275),p=n(46479),i=n(31009);const s=({handle:e,postId:t,nonce:n})=>{const a=(0,c.Q)(),o=l.S.posts.singlePost.useQuery({handle:e,postId:t,nonce:n},{suspense:!0}),s=(0,r.useMemo)((()=>o.data?.post.headline?`"${o.data.post.headline}"`:`post from @${o.data?.post.postingProject.handle??"unknown"}`),[o.data?.post.headline,o.data?.post.postingProject.handle]);return o.data?r.createElement(r.Fragment,null,r.createElement(m.ql,{title:s}),r.createElement("div",{className:"mt-4 flex flex-col gap-4"},r.createElement(i.w_,{viewModel:o.data.post}),r.createElement(p.G,{viewModel:o.data.post,highlightedTags:[],condensed:!0,skipCollapse:!0,showThreadCollapser:!1,displayPrefs:a,commentThreads:o.data.comments}))):null},d=({project:e,postId:t,nonce:n})=>r.createElement("div",{className:"container mx-auto flex flex-grow flex-col"},r.createElement(o.Z,{project:e,canAccessPermissions:{canRead:a.c.Allowed,canEdit:a.c.NotAllowed,canShare:a.c.Allowed,canInteract:a.c.Allowed}},r.createElement(s,{postId:t,nonce:n,handle:e.handle})));var g=d;d.displayName="single-post-view"},31009:function(e,t,n){n.d(t,{b4:function(){return p},vv:function(){return i},w_:function(){return m}});var a=n(22233),r=n(12093),o=n(85771),l=n(94159),c=n(90275);const m=({viewModel:e})=>{const t=(0,l.useMemo)((()=>e.transparentShareOfPostId?e.shareTree.find((t=>t.postId===e.transparentShareOfPostId))??e:e),[e]),n=(0,l.useMemo)((()=>(0,o.Jp)(t.blocks)),[t.blocks]),m=`${t.postingProject.displayName?t.postingProject.displayName:`@${t.postingProject.handle}`} on cohost`;return l.createElement(c.ql,null,l.createElement("meta",{property:"og:site_name",content:m}),t.headline?l.createElement("meta",{property:"og:title",content:t.headline}):l.createElement("meta",{property:"og:title",content:m}),l.createElement("meta",{property:"og:description",content:(0,a.BS)(t,{myPost:!1,skipHeadline:!0})}),l.createElement("meta",{property:"og:type",content:"article"}),l.createElement("meta",{property:"article:published_time",content:t.publishedAt}),l.createElement("meta",{property:"article:author",content:r.ZP.public.project.mainAppProfile({projectHandle:t.postingProject.handle}).toString()}),l.createElement("meta",{property:"og:url",content:e.singlePostPageUrl.toString()}),l.createElement("link",{href:e.singlePostPageUrl.toString(),rel:"alternate",type:"application/activity+json"}),t.tags.map((e=>l.createElement("meta",{property:"article:tag",content:e,key:e}))),t.effectiveAdultContent||0!==t.cws.length?null:n.map((e=>{switch(e.attachment.kind){case"image":return l.createElement("meta",{key:e.attachment.attachmentId,property:"og:image",content:e.attachment.fileURL});case"audio":return l.createElement("meta",{key:e.attachment.attachmentId,property:"og:audio",content:e.attachment.fileURL})}})),n.length?l.createElement("meta",{property:"twitter:card",content:"summary_large_image"}):function({props:{children:e}},t){return l.Children.toArray(e).filter(l.isValidElement).map(((e,n)=>(0,l.cloneElement)(e,{key:`${t}-${n}`})))}(l.createElement(l.Fragment,null,l.createElement("meta",{property:"og:image",content:t.postingProject.avatarURL}),l.createElement("meta",{property:"og:image:alt",content:t.postingProject.handle}),l.createElement("meta",{property:"og:image:width",content:"128"}),l.createElement("meta",{property:"og:image:height",content:"128"}),l.createElement("meta",{property:"twitter:card",content:"summary"})),"avatar"))},p=({project:e})=>{const t=`${e.displayName?e.displayName:`@${e.handle}`} on cohost`;return l.createElement(c.ql,null,l.createElement("meta",{property:"og:site_name",content:"cohost"}),l.createElement("meta",{property:"og:title",content:t}),e.dek?l.createElement("meta",{property:"og:description",content:e.dek}):null,l.createElement("meta",{property:"og:type",content:"profile"}),e.displayName?l.createElement("meta",{property:"profile:first_name",content:e.displayName}):null,l.createElement("meta",{property:"profile:username",content:e.handle}),l.createElement("meta",{property:"og:url",content:r.ZP.public.project.mainAppProfile({projectHandle:e.handle}).toString()}),l.createElement("meta",{property:"og:image",content:e.avatarURL}),l.createElement("meta",{property:"og:image:alt",content:e.handle}),l.createElement("meta",{property:"og:image:width",content:"128"}),l.createElement("meta",{property:"og:image:height",content:"128"}),l.createElement("meta",{property:"twitter:card",content:"summary"}))},i=({tagName:e})=>l.createElement(c.ql,null,l.createElement("meta",{property:"og:site_name",content:"cohost"}),l.createElement("meta",{property:"og:title",content:`#${e} on cohost`}),l.createElement("meta",{property:"og:description",content:`read more posts about #${e} on cohost`}),l.createElement("meta",{property:"og:type",content:"website"}),l.createElement("meta",{property:"og:url",content:r.ZP.public.tags({tagSlug:e}).toString()}),l.createElement("meta",{property:"twitter:card",content:"summary"}))}}]);
|
|
//# sourceMappingURL=client-preact-components-pages-single-post-view.54bc4e1d90c7c9696b34.js.map
|