Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	yarn.lock
  • Loading branch information
Ridel1e committed Jul 8, 2024
2 parents 4ec1641 + 83f5333 commit e1af1cf
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spectrumlabs/interface",
"version": "5.0.32",
"version": "5.0.35",
"private": false,
"scripts": {
"start": "vite",
Expand All @@ -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.310",
"@spectrumlabs/cardano-dex-sdk": "^0.1.312",
"@types/file-saver": "^2.0.5",
"@types/lodash": "^4.14.172",
"@types/numeral": "^2.0.2",
Expand Down
17 changes: 17 additions & 0 deletions src/ApplicationRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { localStorageManager, Modal } from '@ergolabs/ui-kit';
import { fireAnalyticsEvent, getBrowser, user } from '@spectrumlabs/analytics';
import { DateTime } from 'luxon';
import { FC, useEffect } from 'react';
Expand All @@ -8,6 +9,7 @@ import { NetworkDomManager } from './common/services/NetworkDomManager/NetworkDo
import { Layout } from './components/common/Layout/Layout';
import { RouteConfigExtended } from './components/RouterTitle/RouteConfigExtended';
import { RouterTitle } from './components/RouterTitle/RouterTitle';
import { SplashModal } from './components/SplashModal/SplashModal.tsx';
import { useApplicationSettings } from './context';
import { AddLiquidity } from './pages/AddLiquidity/AddLiquidity';
import { CreatePool } from './pages/CreatePool/CreatePool';
Expand Down Expand Up @@ -140,6 +142,9 @@ export const ApplicationRoutes: FC = () => {

const [settings] = useApplicationSettings();

const openSplashModal = () =>
Modal.open(({ close }) => <SplashModal close={close} />);

useEffect(() => {
fireAnalyticsEvent('App Loaded');

Expand All @@ -150,6 +155,18 @@ export const ApplicationRoutes: FC = () => {
user.set('locale_active', settings.lang);
}, []);

useEffect(() => {
const network = localStorageManager.get('spectrum-selected-network-key');

if (network !== 'ergo') {
const timer = setTimeout(() => {
openSplashModal();
}, 5000);

return () => clearTimeout(timer);
}
}, []);

return (
<>
<RouterTitle
Expand Down
47 changes: 47 additions & 0 deletions src/components/SplashModal/SplashModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { Button, Flex, Modal, Typography, useDevice } from '@ergolabs/ui-kit';
import { Trans } from '@lingui/macro';
import { CSSProperties } from 'react';
import * as React from 'react';

export const SplashModal: React.FC<{ close: (result?: any) => void }> = ({
close,
}) => {
const { valBySize } = useDevice();

const handleClick = () => {
window.open('https://app.splash.trade', '_blank');
close();
};

return (
<>
<Modal.Title>
<Typography.Title level={3}>Product Update</Typography.Title>
</Modal.Title>
<Modal.Content width={valBySize<CSSProperties['width']>('100%', 480)}>
<Flex col gap={4}>
<Typography.Body>
Spectrum Cardano DEX will change its brand name to Splash soon.
<br />
All pools will be migrated to the Splash interface.
<br />
Funds will be accessible through the new interface.
</Typography.Body>
<Typography.Body strong>
This interface will be shut down on 1st Aug 2024.
</Typography.Body>
<Flex justify="center">
<Button
type="primary"
size="large"
width={'130px'}
onClick={handleClick}
>
<Trans>Go to Splash</Trans>
</Button>
</Flex>
</Flex>
</Modal.Content>
</>
);
};
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.310":
version "0.1.310"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.310.tgz#026b72834f403ba3b6a1f2a90dbf0929875a594e"
integrity sha512-jydJgoO8Qxafl/akpqHWPiHyaQm2E1UqVupTzhBlHLiZtRqK0Bt9gkFwoY5pxd83woFRq2NPhg8QVx51k25FqA==
"@spectrumlabs/cardano-dex-sdk@^0.1.312":
version "0.1.312"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.312.tgz#3e9fcedbbd10e3a1ba30c51350933f90ab65b442"
integrity sha512-vU+z/OGp3/c5WAQl9kaa2WuwS1s1GvFpi8TAbRyp02tRSGOg7ef2QIyCjUFCO/inUgFk8w5Eb4RLjkfKvaPAyQ==
dependencies:
"@emurgo/cardano-serialization-lib-browser" "^11.5.0"
axios "^0.21.1"
Expand Down

0 comments on commit e1af1cf

Please sign in to comment.