@compass-labs/widgets 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4668,7 +4668,7 @@ function EarnAccount({
4668
4668
  defaultMarketType = "aave",
4669
4669
  defaultMinTvl = 0
4670
4670
  }) {
4671
- const { address, signTypedData, switchChain, walletChainId } = useEmbeddableWallet();
4671
+ const { address, isConnected, login, signTypedData, switchChain, walletChainId } = useEmbeddableWallet();
4672
4672
  const { isDeployed } = useEarnAccount();
4673
4673
  const { chainId: CHAIN_ID } = useChain();
4674
4674
  const queryClient = useQueryClient();
@@ -5695,8 +5695,8 @@ function EarnAccount({
5695
5695
  /* @__PURE__ */ jsx(
5696
5696
  "button",
5697
5697
  {
5698
- onClick: handleAction,
5699
- disabled: isProcessing || !selectedMarket || !amount || parseFloat(amount) <= 0 || parseFloat(amount) > maxAmount,
5698
+ onClick: !isConnected && login ? login : handleAction,
5699
+ disabled: isConnected && (isProcessing || !selectedMarket || !amount || parseFloat(amount) <= 0 || parseFloat(amount) > maxAmount),
5700
5700
  className: "w-full font-semibold transition-all disabled:opacity-50 disabled:cursor-not-allowed",
5701
5701
  style: {
5702
5702
  backgroundColor: "var(--compass-color-primary)",
@@ -5706,7 +5706,7 @@ function EarnAccount({
5706
5706
  fontSize: compact ? "0.875rem" : "1rem",
5707
5707
  transition: "var(--compass-transition-normal)"
5708
5708
  },
5709
- children: isProcessing ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center", style: { gap: "calc(var(--compass-spacing-unit) * 0.5)" }, children: [
5709
+ children: !isConnected ? "Connect Wallet" : isProcessing ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center", style: { gap: "calc(var(--compass-spacing-unit) * 0.5)" }, children: [
5710
5710
  /* @__PURE__ */ jsx(Loader2, { size: compact ? 16 : 20, className: "animate-spin" }),
5711
5711
  "Processing..."
5712
5712
  ] }) : !selectedMarket ? "Select a market" : needsActionSwap ? activeTab === "deposit" ? `Swap & Deposit` : `Withdraw & Swap` : activeTab === "deposit" ? "Deposit funds" : "Withdraw funds"