Skip to content

Commit

Permalink
clear token choices if pool type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira committed Nov 27, 2024
1 parent b86093a commit c84a2ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/nextjs/app/v3/_components/ChooseType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { PoolType } from "@balancer/sdk";
import { InformationCircleIcon } from "@heroicons/react/24/outline";
import { usePoolCreationStore } from "~~/hooks/v3";
import { AllowedPoolTypes } from "~~/hooks/v3/usePoolCreationStore";
import { AllowedPoolTypes, initialTokenConfig } from "~~/hooks/v3/usePoolCreationStore";

const POOL_TYPES: AllowedPoolTypes[] = [PoolType.Weighted, PoolType.Stable];

Expand All @@ -14,7 +14,7 @@ const POOL_TYPE_DESCRIPTIONS: Record<AllowedPoolTypes, string> = {
};

export function ChooseType() {
const { poolType, updatePool, tokenConfigs } = usePoolCreationStore();
const { poolType, updatePool } = usePoolCreationStore();

return (
<>
Expand Down Expand Up @@ -47,7 +47,7 @@ export function ChooseType() {
? `bg-primary text-primary-content`
: `bg-base-100 hover:bg-primary hover:text-primary-content hover:opacity-50`
} p-7 w-full rounded-xl text-lg text shadow-lg`}
onClick={() => updatePool({ poolType: type, tokenConfigs: [...tokenConfigs.slice(0, 4)] })}
onClick={() => updatePool({ poolType: type, tokenConfigs: [initialTokenConfig, initialTokenConfig] })}
>
<div className="flex flex-col text-center">
<div className="font-bold text-xl mb-2 w-full">{type}</div>
Expand Down

0 comments on commit c84a2ac

Please sign in to comment.