Skip to content

Commit

Permalink
Fix for hidden share buttons; (#337)
Browse files Browse the repository at this point in the history
* Fix for hidden share buttons;

* Cleanup;
  • Loading branch information
stef-coenen authored Oct 15, 2024
1 parent cf062d8 commit f63819b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const PostInteracts = ({

isAuthenticated,
isOwner,
isPublic,
defaultExpanded,
allowExpand = true,
showSummary = false,
Expand All @@ -44,7 +43,6 @@ export const PostInteracts = ({

isAuthenticated?: boolean;
isOwner?: boolean;
isPublic?: boolean;
defaultExpanded?: boolean;
allowExpand?: boolean;
showSummary?: boolean;
Expand Down Expand Up @@ -94,6 +92,8 @@ export const PostInteracts = ({
[postFile.fileMetadata.reactionPreview]
);

const isPublic = !postFile.fileMetadata.isEncrypted;

return (
<div className={`${className ?? ''}`}>
<div
Expand Down
13 changes: 1 addition & 12 deletions packages/common-app/src/socialFeed/PostDetail/PostDetailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import {
PrimaryMedia,
ToGroupBlock,
} from '../../..';
import {
DEFAULT_PAYLOAD_KEY,
HomebaseFile,
NewHomebaseFile,
SecurityGroupType,
} from '@homebase-id/js-lib/core';
import { DEFAULT_PAYLOAD_KEY, HomebaseFile, NewHomebaseFile } from '@homebase-id/js-lib/core';

export const PostDetailCard = ({
odinId,
Expand Down Expand Up @@ -217,12 +212,6 @@ export const PostDetailCard = ({
isAuthenticated={isAuthenticated}
isOwner={isOwner}
login={login}
isPublic={
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Anonymous ||
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Authenticated
}
/>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import {
} from '@homebase-id/js-lib/public';
import { useEffect } from 'react';

import {
DEFAULT_PAYLOAD_KEY,
HomebaseFile,
NewHomebaseFile,
SecurityGroupType,
} from '@homebase-id/js-lib/core';
import { DEFAULT_PAYLOAD_KEY, HomebaseFile, NewHomebaseFile } from '@homebase-id/js-lib/core';
import { getAnonymousDirectImageUrl } from '@homebase-id/js-lib/media';
import { Helmet } from 'react-helmet-async';
import { Video } from '../../media/Video';
Expand Down Expand Up @@ -230,12 +225,6 @@ export const PostImageDetailCard = ({
isAuthenticated={isAuthenticated}
isOwner={isOwner}
login={login}
isPublic={
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Anonymous ||
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Authenticated
}
/>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BlogConfig, PostContent } from '@homebase-id/js-lib/public';
import { FC } from 'react';
import { PostMeta } from '../Blocks/Meta/Meta';
import { useNavigate } from 'react-router-dom';
import { HomebaseFile, SecurityGroupType } from '@homebase-id/js-lib/core';
import { HomebaseFile } from '@homebase-id/js-lib/core';
import { FakeAnchor, ErrorBoundary } from '../../ui';
import { AuthorImage } from '../Blocks/Author/Image';
import { AuthorName } from '../Blocks/Author/Name';
Expand Down Expand Up @@ -113,12 +113,6 @@ export const PostTeaser: FC<PostTeaserProps> = ({
showSummary={true}
isOwner={isOwner}
isAuthenticated={isAuthenticated}
isPublic={
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Anonymous ||
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Authenticated
}
login={login}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ const PostTeaserCard: FC<PostTeaserCardProps> = ({ className, odinId, postFile,
showSummary={showSummary}
isAuthenticated={true}
isOwner={true}
isPublic={
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Anonymous ||
channel?.serverMetadata?.accessControlList?.requiredSecurityGroup ===
SecurityGroupType.Authenticated
}
/>
</FakeAnchor>
</ErrorBoundary>
Expand Down

0 comments on commit f63819b

Please sign in to comment.