Skip to content

Commit

Permalink
feat: make swap oa public (#4791)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint authored Apr 4, 2024
2 parents bf0b76d + c6c5a9b commit f610cd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import type { FC } from 'react';

import { BanknotesIcon } from '@heroicons/react/24/outline';
import { OpenAction } from '@hey/data/enums';
import { FeatureFlag } from '@hey/data/feature-flags';
import { TipIcon } from '@hey/icons';
import isFeatureAvailable from '@lib/isFeatureAvailable';
import {
ScreenType,
useOpenActionStore
Expand All @@ -20,15 +18,12 @@ const OpenActionsList: FC = () => {
return screen === ScreenType.List ? (
<div className="p-5">
<div className="mb-5 space-y-3">
{(isFeatureAvailable('swap-oa') ||
isFeatureAvailable(FeatureFlag.LensTeam)) && (
<OpenActionItem
description="Swap any ERC-20 token"
icon={<BanknotesIcon className="size-6" />}
title="Token Swap"
type={OpenAction.Swap}
/>
)}
<OpenActionItem
description="Swap any ERC-20 token"
icon={<BanknotesIcon className="size-6" />}
title="Token Swap"
type={OpenAction.Swap}
/>
<OpenActionItem
description="Add ability to tip"
icon={<TipIcon className="size-6" />}
Expand Down
16 changes: 6 additions & 10 deletions apps/web/src/components/Publication/OpenAction/OnBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import type {
} from '@hey/lens';
import type { FC } from 'react';

import { FeatureFlag } from '@hey/data/feature-flags';
import { VerifiedOpenActionModules } from '@hey/data/verified-openaction-modules';
import { isMirrorPublication } from '@hey/lib/publicationHelpers';
import isFeatureAvailable from '@lib/isFeatureAvailable';

import SwapOpenAction from './UnknownModule/Swap';

Expand All @@ -30,14 +28,12 @@ const OpenActionOnBody: FC<OpenActionOnBodyProps> = ({ publication }) => {

return (
<div className="mt-3">
{module.contract.address === VerifiedOpenActionModules.Swap &&
(isFeatureAvailable('swap-oa') ||
isFeatureAvailable(FeatureFlag.LensTeam)) && (
<SwapOpenAction
module={module as UnknownOpenActionModuleSettings}
publication={targetPublication}
/>
)}
{module.contract.address === VerifiedOpenActionModules.Swap && (
<SwapOpenAction
module={module as UnknownOpenActionModuleSettings}
publication={targetPublication}
/>
)}
</div>
);
};
Expand Down

1 comment on commit f610cd1

@vercel
Copy link

@vercel vercel bot commented on f610cd1 Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

web-heyxyz.vercel.app
hey.xyz
heyxyz.vercel.app
web-git-main-heyxyz.vercel.app

Please sign in to comment.