diff --git a/.env.example b/.env.example index c6e6bb302..fe81917cb 100644 --- a/.env.example +++ b/.env.example @@ -45,8 +45,6 @@ REACT_APP_RELEASE_NAME= REACT_APP_WALLET_CONNECT_PROJECT_ID= -REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP='{"production-137-0":"248", "testing-80001-0":"26"}' - REACT_APP_VIEW_MODE=dapp # REACT_APP_VIEW_MODE=dr_center # REACT_APP_VIEW_MODE=dapp,dr_center diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8493e8ef6..661486fd3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,6 @@ jobs: REACT_APP_MOONPAY_EXTERNAL_LINK: "https://www.moonpay.com/buy" REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP_TESTING }} REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP_TESTING }} - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: ${{ vars.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -94,7 +93,6 @@ jobs: REACT_APP_MOONPAY_EXTERNAL_LINK: "https://www.moonpay.com/buy" REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP_TESTING }} REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP_TESTING }} - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: ${{ vars.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }} @@ -134,7 +132,6 @@ jobs: REACT_APP_MOONPAY_EXTERNAL_LINK: "https://www.moonpay.com/buy" REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP_STAGING }} REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP_STAGING }} - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: ${{ vars.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }} @@ -174,7 +171,6 @@ jobs: REACT_APP_MOONPAY_EXTERNAL_LINK: "https://www.moonpay.com/buy" REACT_APP_META_TX_API_KEY_MAP: ${{ vars.REACT_APP_META_TX_API_KEY_MAP_PRODUCTION }} REACT_APP_META_TX_API_IDS_MAP: ${{ vars.REACT_APP_META_TX_API_IDS_MAP_PRODUCTION }} - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: ${{ vars.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }} diff --git a/.github/workflows/ci_reusable.yaml b/.github/workflows/ci_reusable.yaml index 31a21b8c0..2c1d32921 100644 --- a/.github/workflows/ci_reusable.yaml +++ b/.github/workflows/ci_reusable.yaml @@ -66,9 +66,6 @@ on: REACT_APP_META_TX_API_IDS_MAP: required: true type: string - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: - required: true - type: string secrets: NPM_TOKEN: required: true @@ -121,7 +118,6 @@ jobs: REACT_APP_DEFAULT_RESOLUTION_PERIOD_DAYS: ${{ secrets.REACT_APP_DEFAULT_RESOLUTION_PERIOD_DAYS }} REACT_APP_INFURA_IPFS_PROJECT_ID: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_ID }} REACT_APP_INFURA_IPFS_PROJECT_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_PROJECT_SECRET }} - REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP: ${{ inputs.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP }} REACT_APP_GOOGLE_TAG_ID: ${{ secrets.REACT_APP_GOOGLE_TAG_ID }} REACT_APP_META_TX_API_KEY_MAP: ${{ inputs.REACT_APP_META_TX_API_KEY_MAP }} REACT_APP_META_TX_API_IDS_MAP: ${{ inputs.REACT_APP_META_TX_API_IDS_MAP }} diff --git a/src/components/offer/OfferCard.tsx b/src/components/offer/OfferCard.tsx deleted file mode 100644 index c015a33c2..000000000 --- a/src/components/offer/OfferCard.tsx +++ /dev/null @@ -1,192 +0,0 @@ -import { generatePath, useLocation } from "react-router-dom"; -import styled, { css } from "styled-components"; - -import RootPrice from "../../components/price"; -import { clamp } from "../../components/ui/styles"; -import { UrlParameters } from "../../lib/routing/parameters"; -import { BosonRoutes, OffersRoutes } from "../../lib/routing/routes"; -import { colors } from "../../lib/styles/colors"; -import { Offer } from "../../lib/types/offer"; -import { Exchange } from "../../lib/utils/hooks/useExchanges"; -import { useKeepQueryParamsNavigate } from "../../lib/utils/hooks/useKeepQueryParamsNavigate"; -import Image from "../ui/Image"; -import SellerID from "../ui/SellerID"; -import { Typography } from "../ui/Typography"; -import ExchangeStatuses from "./ExchangeStatuses"; -import OfferBanner from "./OfferBanner"; -import OfferStatuses from "./OfferStatuses"; - -const Card = styled.div<{ isCarousel: boolean }>` - display: inline-block; - background-color: ${colors.white}; - position: relative; - width: 100%; - cursor: pointer; - border: 1px solid ${colors.black}20; - color: ${colors.black}; - - ${({ isCarousel }) => - !isCarousel - ? css` - transition: all 300ms ease-in-out; - transition: box-shadow 300ms; - - &:hover { - box-shadow: - 0px 0px 0px rgba(0, 0, 0, 0.05), - 4px 4px 4px rgba(0, 0, 0, 0.05), - 8px 8px 8px rgba(0, 0, 0, 0.05), - 16px 16px 16px rgba(0, 0, 0, 0.05); - - img[data-testid] { - transform: translate(-50%, -50%) scale(1.05); - } - } - ` - : ""} -`; - -const Content = styled.div` - padding: 1rem 1.5rem; -`; - -const BasicInfoContainer = styled.div` - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - gap: 4px; - margin: 4px 0; - min-height: 4rem; -`; - -const Name = styled(Typography)` - ${clamp} - font-weight: 600; - margin: 0; -`; - -const Price = styled(RootPrice)` - font-size: 1rem; - font-weight: 600; -`; - -const PriceText = styled(Typography)` - color: ${colors.darkGrey}; - font-size: 0.875rem; -`; - -const getCTAPath = ( - action: Props["action"], - { - offerId, - exchangeId - }: { offerId: Props["offer"]["id"]; exchangeId: string | undefined } -) => { - if ( - (["redeem", "contact-seller"] as Action[]).includes(action as Action) && - exchangeId - ) { - return generatePath(BosonRoutes.Exchange, { - [UrlParameters.exchangeId]: exchangeId - }); - } - return generatePath(OffersRoutes.OfferDetail, { - [UrlParameters.offerId]: offerId - }); -}; - -export type Action = "commit" | "redeem" | "contact-seller" | null; - -interface Props { - offer: Offer; - exchange?: Exchange; - showSeller?: boolean; - action?: Action; - dataTestId: string; - isPrivateProfile?: boolean; - isCarousel?: boolean; - type?: "gone" | "hot" | "soon" | undefined; -} -export default function OfferCard({ - offer, - exchange, - showSeller, - action, - dataTestId, - isPrivateProfile, - isCarousel = false, - type -}: Props) { - const offerId = offer.id; - const isSellerVisible = showSeller === undefined ? true : showSeller; - const offerImg = offer.metadata?.imageUrl ?? ""; - const name = offer.metadata?.name || "Untitled"; - const sellerAddress = offer.seller?.assistant; - - const location = useLocation(); - const navigate = useKeepQueryParamsNavigate(); - - if (!offer) { - return null; - } - const path = getCTAPath(action, { offerId, exchangeId: exchange?.id }); - - const isClickable = !!path; - const onClick: React.MouseEventHandler = (e) => { - e.stopPropagation(); - isClickable && - navigate( - { pathname: path }, - { - state: { - from: location.pathname - } - } - ); - }; - - const Status = isPrivateProfile ? ( - exchange ? ( - - ) : ( - - ) - ) : ( - <> - ); - - return ( - - {Status} - - {!isCarousel && } - - - {isSellerVisible && sellerAddress && ( - - Price - - )} - - - - {name || "Untitled"} - - {offer.exchangeToken && ( - - )} - - - - ); -} diff --git a/src/lib/config.ts b/src/lib/config.ts index 7877b1f3d..4612d1bc1 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -81,25 +81,6 @@ function getMetaTxApiKey(envConfig: ProtocolConfig) { return apiKey; } -function getCarouselPromotedSellerId( - envConfig: ProtocolConfig -): string | undefined { - let carouselPromotedSellerId: string | undefined; - const sellerMap = process.env.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_MAP; - if (sellerMap) { - try { - const carouselPromotedSellerIdMap = JSON.parse(sellerMap || "{}"); - carouselPromotedSellerId = - carouselPromotedSellerIdMap[envConfig.configId]; - } catch (error) { - console.error(error); - Sentry.captureException(error); - } - } - - return carouselPromotedSellerId; -} - export const envConfigsFilteredByEnv: ProtocolConfig[] = getEnvConfigs(envName); export const envChainIds = envConfigsFilteredByEnv.map( (envConf) => envConf.chainId @@ -222,8 +203,7 @@ export const getDappConfig = (envConfig: ProtocolConfig) => { LENS_PROFILES_CONTRACT_PARTIAL_ABI: envConfig.lens?.LENS_PROFILES_CONTRACT_PARTIAL_ABI, LENS_FOLLOW_NFT_ABI: lensFollowNftContractAbi - }, - carouselPromotedSellerId: getCarouselPromotedSellerId(envConfig) + } }; }; diff --git a/src/pages/landing/Step.tsx b/src/pages/landing/Step.tsx deleted file mode 100644 index 7b2d83183..000000000 --- a/src/pages/landing/Step.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import styled from "styled-components"; - -import { Typography } from "../../components/ui/Typography"; -import { breakpoint } from "../../lib/styles/breakpoint"; -import { colors } from "../../lib/styles/colors"; -import { zIndex } from "../../lib/styles/zIndex"; - -const StepWrapper = styled.div` - display: flex; - flex-direction: column; - align-items: center; - gap: 0.75rem; - ${breakpoint.xxs} { - gap: 1.5rem; - } - flex: 1; - width: 100%; - [data-testid="number"] { - font-size: 3.5rem; - font-weight: 600; - line-height: 1.2; - position: relative; - color: var(--accent); - margin-bottom: 0.5rem !important; - z-index: ${zIndex.CommitStep}; - &:after { - content: ""; - position: absolute; - z-index: ${zIndex.CommitStep - 1}; - width: 100%; - height: 50%; - top: 50%; - left: 0%; - background: var(--primary, ${colors.green}); - } - } - [data-testid="step-title"] { - all: unset; - font-size: 1.5rem; - font-weight: 600; - line-height: 1.5; - } - [data-testid="number"], - [data-testid="step-title"], - p { - text-align: center; - margin: 0; - } -`; - -interface IStep { - children?: string | React.ReactNode; - number: number; - title: string; -} - -const Step: React.FC = ({ children, number, title, ...props }) => { - return ( - - - 0{number} - - - {title} - - {children} - - ); -}; - -export default Step; diff --git a/src/pages/profile/seller/Offers.tsx b/src/pages/profile/seller/Offers.tsx index 4e4610726..14cac97ba 100644 --- a/src/pages/profile/seller/Offers.tsx +++ b/src/pages/profile/seller/Offers.tsx @@ -1,9 +1,9 @@ import { useMemo } from "react"; -import { Action } from "../../../components/offer/OfferCard"; import OfferList from "../../../components/offers/OfferList"; import { Profile } from "../../../lib/utils/hooks/lens/graphql/generated"; import { ExtendedSeller } from "../../explore/WithAllOffers"; +export type Action = "commit" | "redeem" | "contact-seller" | null; interface Props { products: ExtendedSeller;