MCPcopy Create free account
hub / github.com/dailydotdev/apps / BoostPostButton

Function BoostPostButton

packages/shared/src/features/boost/BoostButton.tsx:33–60  ·  view source on GitHub ↗
({
  post,
  buttonProps = {},
}: {
  post: Post;
  buttonProps?: ButtonProps<'button'>;
})

Source from the content-addressed store, hash-verified

31}
32
33export function BoostPostButton({
34 post,
35 buttonProps = {},
36}: {
37 post: Post;
38 buttonProps?: ButtonProps<'button'>;
39}): ReactElement {
40 const { openModal } = useLazyModal();
41 const campaignId = post?.flags?.campaignId;
42 const { data: campaign, isFetched } = useCampaignById(campaignId);
43
44 const onBoost = () =>
45 openModal({ type: LazyModal.BoostPost, props: { post } });
46
47 const onViewBoost = () =>
48 openModal({ type: LazyModal.BoostedCampaignView, props: { campaign } });
49
50 return (
51 <BoostButton
52 campaignId={campaignId}
53 buttonProps={{
54 ...buttonProps,
55 loading: campaignId && !isFetched,
56 onClick: campaignId ? onViewBoost : onBoost,
57 }}
58 />
59 );
60}

Callers

nothing calls this directly

Calls 2

useLazyModalFunction · 0.90
useCampaignByIdFunction · 0.90

Tested by

no test coverage detected