Skip to content

Commit

Permalink
hide pinboard buttons for recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
fredex42 committed Oct 18, 2024
1 parent 5db0891 commit 45377a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fronts-client/src/components/feed/FeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ interface FeedItemProps {
) => void;
shouldObscureFeed?: boolean;
byline?: string;
noPinboard?: boolean;
}

export class FeedItem extends React.Component<FeedItemProps, {}> {
Expand All @@ -151,6 +152,7 @@ export class FeedItem extends React.Component<FeedItemProps, {}> {
hasVideo,
handleDragStart,
byline,
noPinboard,
} = this.props;

const { preview, live, ophan } = getPaths(id);
Expand Down Expand Up @@ -229,6 +231,7 @@ export class FeedItem extends React.Component<FeedItemProps, {}> {
toolTipPosition={'top'}
toolTipAlign={'right'}
urlPath={liveUrl}
noPinboard={noPinboard}
renderButtons={(props) => (
<>
<HoverViewButton hoverText="View" href={href} {...props} />
Expand Down
1 change: 1 addition & 0 deletions fronts-client/src/components/feed/RecipeFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const RecipeFeedItem = ({ id, showTimes }: ComponentProps) => {
handleDragStart={handleDragStartForCard(CardTypesMap.RECIPE, recipe)}
onAddToClipboard={onAddToClipboard}
shouldObscureFeed={shouldObscureFeed}
noPinboard={true}
bodyContent={
<>
<FeedItemTitle>{recipe.title}</FeedItemTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface WrapperProps {
toolTipAlign: 'left' | 'center' | 'right';
urlPath: string | undefined;
renderButtons: (renderProps: ButtonProps) => JSX.Element;
noPinboard?: boolean;
}

export const HoverActionsButtonWrapper = ({
Expand All @@ -53,6 +54,7 @@ export const HoverActionsButtonWrapper = ({
size,
urlPath,
renderButtons,
noPinboard,
}: WrapperProps) => {
const [toolTipText, setToolTipText] = useState<string | undefined>(undefined);

Expand All @@ -79,7 +81,7 @@ export const HoverActionsButtonWrapper = ({
hideToolTip,
size,
})}
{urlPath && (
{urlPath && !noPinboard && (
// the below tag is empty and meaningless to the fronts tool itself, but serves as a handle for
// Pinboard to attach itself via, identified/distinguished by the urlPath data attribute
// @ts-ignore
Expand Down

0 comments on commit 45377a0

Please sign in to comment.