Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Nov 29, 2023
1 parent abb4946 commit 3f4c292
Show file tree
Hide file tree
Showing 80 changed files with 481 additions and 310 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BosonXmtpClient } from "@bosonprotocol/chat-sdk";
import React, { ReactNode, useEffect, useState } from "react";
import { useCoreSDKWithContext } from "../../../hooks/useCoreSdkWithContext";
import { useCoreSDKWithContext } from "../../../hooks/core-sdk/useCoreSdkWithContext";
import { useEnvContext } from "../../environment/EnvironmentContext";

import { Context } from "./ChatContext";
Expand Down
2 changes: 1 addition & 1 deletion packages/react-kit/src/components/cta/common/CtaButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ButtonTextWrapper, ExtraInfo, LoadingWrapper } from "../common/styles";
import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type Props<T> = CtaButtonProps<T> & {
defaultLabel?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-kit/src/components/cta/common/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { RefObject } from "react";
import { providers } from "ethers";
import { CoreSdkConfig } from "../../../hooks/useCoreSdk";
import { CoreSdkConfig } from "../../../hooks/core-sdk/useCoreSdk";
import { ButtonProps } from "../../buttons/Button";
import { Action } from "../../../hooks/useCtaClickHandler";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Loading } from "../../Loading";
import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { DisputeResolutionFee } from "@bosonprotocol/core-sdk/dist/cjs/accounts";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type IAddFeesDisputeResolverButton = {
exchangeId: BigNumberish;
createSellerArgs: CreateSellerArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Loading } from "../../Loading";
import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { DisputeResolutionFee } from "@bosonprotocol/core-sdk/dist/cjs/accounts";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type IAddSellerToDisputeResolver = {
exchangeId: BigNumberish;
createSellerArgs: CreateSellerArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Loading } from "../../Loading";
import { TransactionResponse } from "@bosonprotocol/common";
import { accounts } from "@bosonprotocol/core-sdk";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type ICreateDisputeResolverButton = {
exchangeId: BigNumberish;
disputeResolverToCreate: accounts.CreateDisputeResolverArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import { BigNumberish, providers } from "ethers";

import { Button } from "../../buttons/Button";
import { useCoreSdk } from "../../../hooks/useCoreSdk";
import { useCoreSdk } from "../../../hooks/core-sdk/useCoreSdk";
import { ButtonTextWrapper, ExtraInfo, LoadingWrapper } from "../common/styles";
import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Loading } from "../../Loading";
import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { DisputeResolutionFee } from "@bosonprotocol/core-sdk/dist/cjs/accounts";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type IRemoveSellerFromDisputeResolverButton = {
exchangeId: BigNumberish;
createSellerArgs: CreateSellerArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish, utils } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Loading } from "../../Loading";
import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { accounts } from "@bosonprotocol/core-sdk";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type IUpdateDisputeResolverButton = {
exchangeId: BigNumberish;
disputeResolverId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumberish } from "ethers";

import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useSignerAddress } from "../../../hooks/useSignerAddress";
import { TransactionReceipt } from "@bosonprotocol/common";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
exchangeToken: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { TransactionReceipt } from "@bosonprotocol/common";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
accountId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CtaButtonProps } from "../common/types";
import { CtaButton } from "../common/CtaButton";
import { useSignerAddress } from "../../../hooks/useSignerAddress";
import { TransactionReceipt } from "@bosonprotocol/common";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
accountId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
import { ButtonSize } from "../../ui/buttonSize";
import { TransactionResponse } from "@bosonprotocol/common";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type Props = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Action } from "../../../hooks/useCtaClickHandler";
import { useSignerAddress } from "../../../hooks/useSignerAddress";
import { CtaButton } from "../common/CtaButton";
import { CtaButtonProps } from "../common/types";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type AdditionalProps = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Loading } from "../../Loading";
import { offers, accounts } from "@bosonprotocol/core-sdk";
import { TransactionResponse } from "@bosonprotocol/common";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type Props = {
hasSellerAccount: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-kit/src/components/cta/offer/VoidButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ButtonTextWrapper, ExtraInfo, LoadingWrapper } from "../common/styles";
import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

type Props = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
export type ICreateSellerButton = {
exchangeId: BigNumberish;
createSellerArgs: CreateSellerArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CtaButtonProps } from "../common/types";
import { Loading } from "../../Loading";
import { UpdateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
import { ButtonSize } from "../../ui/buttonSize";
import { useCoreSdkOverrides } from "../../../hooks/useCoreSdkOverrides";
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";

export type IUpdateSellerButton = {
exchangeId: BigNumberish;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import frame from "assets/frame.png";
import React from "react";
import { ErrorMessage, ErrorMessageProps } from "./ErrorMessage";
import ConnectButton from "../wallet/ConnectButton";

type ConnectWalletErrorMessageProps = Partial<
Pick<ErrorMessageProps, "cta" | "title" | "message">
>;
export function ConnectWalletErrorMessage({
cta,
title,
message
}: ConnectWalletErrorMessageProps) {
return (
<ErrorMessage
cta={cta ?? <ConnectButton />}
message={message ?? "Please connect wallet to proceed"}
title={title ?? "Connect wallet"}
img={<img src={frame} alt={title} />}
/>
);
}
24 changes: 24 additions & 0 deletions packages/react-kit/src/components/error/EmptyErrorMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import frame from "../../assets/frame.png";
import React from "react";
import { ErrorMessage, ErrorMessageProps } from "./ErrorMessage";

type EmptyErrorMessageProps = Pick<
ErrorMessageProps,
"cta" | "title" | "message"
>;
export function EmptyErrorMessage({
cta,
title,
message,
...rest
}: EmptyErrorMessageProps) {
return (
<ErrorMessage
cta={cta}
message={message}
title={title}
img={<img src={frame} alt={title} />}
{...rest}
/>
);
}
Loading

0 comments on commit 3f4c292

Please sign in to comment.