Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/config/ConfigProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ProtocolConfig } from "@bosonprotocol/react-kit";
import { MagicProvider } from "components/magicLink/MagicContext";
import {
CONFIG,
defaultEnvConfig,
envConfigsFilteredByEnv,
getDappConfig
Expand Down Expand Up @@ -33,6 +34,8 @@ function SyncCurrentConfigId({
export function ConfigProvider({ children }: ConfigProviderProps) {
const [envConfig, setEnvConfig] = useState<ProtocolConfig>(defaultEnvConfig);
const dappConfig = getDappConfig(envConfig || defaultEnvConfig);
// TODO: change at core-component level
dappConfig.lens.ipfsGateway = CONFIG.ipfsGateway;
return (
<Context.Provider value={{ config: dappConfig, setEnvConfig }}>
<MagicProvider>
Expand Down
9 changes: 8 additions & 1 deletion src/components/offers/OfferList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styled from "styled-components";
import { BosonRoutes } from "../../lib/routing/routes";
import { colors } from "../../lib/styles/colors";
import { Offer } from "../../lib/types/offer";
import { Profile } from "../../lib/utils/hooks/lens/graphql/generated";
import { useKeepQueryParamsNavigate } from "../../lib/utils/hooks/useKeepQueryParamsNavigate";
import { useIsCustomStoreValueChanged } from "../../pages/custom-store/useIsCustomStoreValueChanged";
import { ExtendedOffer } from "../../pages/explore/WithAllOffers";
Expand All @@ -30,6 +31,10 @@ interface Props {
itemsPerRow?: Partial<ItemsPerRow>;
breadcrumbs?: boolean;
numOffers: number;
seller: {
sellerId: string;
lensProfile?: Profile;
};
}

const Container = styled.div<{ $isPrimaryBgChanged: boolean }>`
Expand Down Expand Up @@ -61,7 +66,8 @@ export default function OfferList({
numOffers,
showInvalidOffers,
itemsPerRow,
breadcrumbs
breadcrumbs,
seller
}: Props) {
const isPrimaryBgChanged = useIsCustomStoreValueChanged("primaryBgColor");
const navigate = useKeepQueryParamsNavigate();
Expand Down Expand Up @@ -165,6 +171,7 @@ export default function OfferList({
key={offer.id}
offer={offer}
dataTestId="offer"
lensProfile={seller?.lensProfile}
/>
)
);
Expand Down
10 changes: 8 additions & 2 deletions src/pages/profile/seller/Offers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ 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";

interface Props {
products: ExtendedSeller;
sellerId: string;
seller: {
sellerId: string;
lensProfile?: Profile;
};
action: Action;
showInvalidOffers: boolean;
isPrivateProfile: boolean;
Expand All @@ -18,7 +22,8 @@ export default function Offers({
action,
showInvalidOffers,
isPrivateProfile,
isLoading
isLoading,
seller
}: Props) {
const allOffers = useMemo(() => {
return products?.offers || [];
Expand All @@ -41,6 +46,7 @@ export default function Offers({
l: 3,
xl: 3
}}
seller={seller}
/>
);
}
2 changes: 1 addition & 1 deletion src/pages/profile/seller/Seller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export default function Seller() {
<Tabs
products={products?.[0]}
isPrivateProfile={isMySeller}
sellerId={sellerId}
seller={{ sellerId, lensProfile: sellerLens }}
isErrorSellers={isErrorSellers}
isLoading={isLoadingProducts}
/>
Expand Down
16 changes: 10 additions & 6 deletions src/pages/profile/seller/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AccountQueryParameters } from "../../../lib/routing/parameters";
import { useQueryParameter } from "../../../lib/routing/useQueryParameter";
import { breakpoint } from "../../../lib/styles/breakpoint";
import { colors } from "../../../lib/styles/colors";
import { Profile } from "../../../lib/utils/hooks/lens/graphql/generated";
import { ExtendedSeller } from "../../explore/WithAllOffers";
import { ProfileSectionWrapper } from "../ProfilePage.styles";
import Exchanges from "./Exchanges";
Expand Down Expand Up @@ -110,15 +111,18 @@ const tabIdentifier = "id" as const;

interface Props {
products: ExtendedSeller;
sellerId: string;
seller: {
sellerId: string;
lensProfile?: Profile;
};
isErrorSellers: boolean;
isPrivateProfile: boolean;
isLoading: boolean;
}
export default function Tabs({
products,
isPrivateProfile,
sellerId,
seller,
isErrorSellers,
isLoading
}: Props) {
Expand All @@ -130,7 +134,7 @@ export default function Tabs({
content: (
<Offers
products={products}
sellerId={sellerId}
seller={seller}
action={isPrivateProfile ? null : "commit"}
showInvalidOffers={isPrivateProfile}
isPrivateProfile={isPrivateProfile}
Expand All @@ -141,16 +145,16 @@ export default function Tabs({
{
id: "exchanges",
title: "Exchanges",
content: <Exchanges sellerId={sellerId} />
content: <Exchanges sellerId={seller.sellerId} />
},
{
id: "redemptions",
title: "Redemptions",
content: <Redemptions sellerId={sellerId} />
content: <Redemptions sellerId={seller.sellerId} />
}
];
return tabsData;
}, [sellerId, isPrivateProfile, products, isLoading]);
}, [seller, isPrivateProfile, products, isLoading]);
const [currentTab, setCurrentTab] = useQueryParameter(
AccountQueryParameters.tab
);
Expand Down