Skip to content

Commit

Permalink
Merge pull request #9976 from hicommonwealth/ryan/farcaster-install-a…
Browse files Browse the repository at this point in the history
…ction

Add button to install farcaster action
  • Loading branch information
rbennettcw authored Nov 21, 2024
2 parents 06ecf31 + 1ba932e commit bc311a4
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { command, config } from '@hicommonwealth/core';
import { Contest } from '@hicommonwealth/model';
import { config, query } from '@hicommonwealth/core';
import { Contest, config as modelConfig } from '@hicommonwealth/model';
import { Button } from 'frames.js/express';
import React from 'react';

Expand All @@ -8,7 +8,7 @@ import { frames } from '../../config';
export const contestCard = frames(async (ctx) => {
const contest_address = ctx.url.pathname.split('/')[1];

const contestManager = await command(Contest.GetContest(), {
const contestManager = await query(Contest.GetContest(), {
actor: { user: { email: '' } },
payload: { contest_address, with_chain_node: true },
});
Expand Down Expand Up @@ -101,6 +101,9 @@ export const contestCard = frames(async (ctx) => {
>
Check Eligibility
</Button>,
<Button key="install" action="link" target={getActionInstallUrl()}>
Install Upvote Action
</Button>,
],
};
});
Expand All @@ -117,3 +120,7 @@ const getBaseUrl = () => {
return 'https://commonwealth.im';
}
};

export const getActionInstallUrl = () =>
// eslint-disable-next-line max-len
`https://warpcast.com/~/add-cast-action?actionType=post&name=Upvote+Content&icon=thumbsup&postUrl=${modelConfig.CONTESTS.FARCASTER_ACTION_URL}`;

0 comments on commit bc311a4

Please sign in to comment.