Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Mar 23, 2024
1 parent c25bf7a commit 4b8dbd0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@sentry/react": "^6.16.1",
"@sentry/tracing": "^6.16.1",
"@spectrumlabs/analytics": "^1.1.9",
"@spectrumlabs/cardano-dex-sdk": "^0.1.308",
"@spectrumlabs/cardano-dex-sdk": "^0.1.309",
"@types/file-saver": "^2.0.5",
"@types/lodash": "^4.14.172",
"@types/numeral": "^2.0.2",
Expand Down
5 changes: 4 additions & 1 deletion src/network/cardano/api/operations/createPool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ export const createPool = (
return subject.asObservable();
};

export const MIN_CREATE_POOL_LIQUIDITY = new Currency(5n, networkAsset);
export const MIN_CREATE_POOL_LIQUIDITY = new Currency(
10000000000n,
networkAsset,
);

export const useCreatePoolValidators =
(): OperationValidator<CreatePoolFormModel>[] => {
Expand Down
12 changes: 11 additions & 1 deletion src/pages/CreatePool/CreatePool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ import { useNetworkAsset } from '../../gateway/api/networkAsset';
import { createPool } from '../../gateway/api/operations/createPool';
import { useHandleCreatePoolMaxButtonClick } from '../../gateway/api/useHandleCreatePoolMaxButtonClick';
import { useCreatePoolValidators } from '../../gateway/api/validationFees';
import { selectedNetwork$ } from '../../gateway/common/network';
import {
selectedNetwork$,
useSelectedNetwork,
} from '../../gateway/common/network';
import { operationsSettings$ } from '../../gateway/widgets/operationsSettings';
import { useGuardV2 } from '../../hooks/useGuard.ts';
import {
defaultTokenList$,
DefaultTokenListItem,
Expand Down Expand Up @@ -95,6 +99,7 @@ const getYAssets = (xId?: string) => {
};

export const CreatePool: FC = () => {
const [selectedNetwork] = useSelectedNetwork();
const [OperationSettings] = useObservable(operationsSettings$);
const [networkAsset] = useNetworkAsset();
const [lastEditedField, setLastEditedField] = useState<'x' | 'y'>('x');
Expand All @@ -112,6 +117,11 @@ export const CreatePool: FC = () => {
});
const [createPoolFormValue] = useObservable(form.valueChangesWithSilent$, []);

useGuardV2(
() => selectedNetwork.name !== 'ergo',
() => navigate('../../liquidity'),
);

const updateYAssets$ = useMemo(
() => new BehaviorSubject<string | undefined>(undefined),
[],
Expand Down
19 changes: 11 additions & 8 deletions src/pages/Liquidity/default/LiquidityDefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FC } from 'react';
import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';

import { IsErgo } from '../../../components/IsErgo/IsErgo.tsx';
import { SearchInput } from '../../../components/SearchInput/SearchInput';
import { LiquidityFilter } from '../common/components/LiquidityFilter/LiquidityFilter';
import { LiquidityLayoutProps } from '../common/types/LiquidityLayoutProps';
Expand Down Expand Up @@ -68,14 +69,16 @@ export const LiquidityDefaultLayout: FC<LiquidityLayoutProps> = ({
<Flex.Item marginRight={1}>
<LiquidityFilter value={filters} onChange={setFilters} />
</Flex.Item>
<Button
size="large"
onClick={() => {
navigate('create');
}}
>
<Trans>Create Pool</Trans>
</Button>
<IsErgo>
<Button
size="large"
onClick={() => {
navigate('create');
}}
>
<Trans>Create Pool</Trans>
</Button>
</IsErgo>
</Flex>
),
}}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3337,10 +3337,10 @@
dependencies:
"@amplitude/analytics-browser" "^1.9.0"

"@spectrumlabs/cardano-dex-sdk@^0.1.308":
version "0.1.308"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.308.tgz#9097d93441ca8fe17c324f57f9c84588bc05eb36"
integrity sha512-X+fqy0VFiyN7kNG+88FsxnmnSbWPmusvAaqeX4cavrftM7vcnOZcoa578mpEwKizluFs2vzd0T+9I4dM0NOLWA==
"@spectrumlabs/cardano-dex-sdk@^0.1.309":
version "0.1.309"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.309.tgz#f0f68913636c0df2be41088aed71a049fff7e521"
integrity sha512-s5px+8AwoVy5SkveRSeTM1/bnvu5ZTW6maTawA+NJljQ4Ty5gtGtv0CrYS3h0da//YD67QdTK3i1nk5CYHtZ5g==
dependencies:
"@emurgo/cardano-serialization-lib-browser" "^11.5.0"
axios "^0.21.1"
Expand Down

0 comments on commit 4b8dbd0

Please sign in to comment.