diff --git a/apps/trading/.env.mainnet b/apps/trading/.env.mainnet index 9b43a8c28..19f9f45cb 100644 --- a/apps/trading/.env.mainnet +++ b/apps/trading/.env.mainnet @@ -17,10 +17,6 @@ NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-ma NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/firefox/addon/vega-wallet-mainnet NX_ORACLE_PROOFS_URL=https://raw.githubusercontent.com/vegaprotocol/well-known/main/__generated__/oracle-proofs.json - -# TAG name of the current app version - TODO: bump to the latest upon release -NX_APP_VERSION=v0.21.2-core-0.72.14 - # Cosmic elevator flags NX_SUCCESSOR_MARKETS=true NX_STOP_ORDERS=true diff --git a/apps/trading/components/banner/index.tsx b/apps/trading/components/banner/index.tsx index d1f7dda97..d7686c0b9 100644 --- a/apps/trading/components/banner/index.tsx +++ b/apps/trading/components/banner/index.tsx @@ -1,2 +1 @@ export * from './announcement-banner'; -export * from './upgrade-banner'; diff --git a/apps/trading/components/banner/upgrade-banner.tsx b/apps/trading/components/banner/upgrade-banner.tsx deleted file mode 100644 index 2db9a08a6..000000000 --- a/apps/trading/components/banner/upgrade-banner.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { useMemo, useState } from 'react'; -import { gt, prerelease } from 'semver'; -import { - ReleasesFeed, - useEnvironment, - useReleases, - Networks, -} from '@vegaprotocol/environment'; -import { t } from '@vegaprotocol/i18n'; -import { - CopyWithTooltip, - ExternalLink, - Intent, - NotificationBanner, - VegaIcon, - VegaIconNames, -} from '@vegaprotocol/ui-toolkit'; - -// v0.20.12-core-0.71.4 -> v0.20.12 -// we need to strip the "core" suffix in order to determine whether a release -// is a pre-release (candidate); example: v.0.21.0-beta.1-core-0.71.4 -const parseTagName = (tagName: string) => tagName.replace(/-core-[\d.]+$/i, ''); - -type UpgradeBannerProps = { - showVersionChange: boolean; -}; -export const UpgradeBanner = ({ showVersionChange }: UpgradeBannerProps) => { - const [visible, setVisible] = useState(true); - const { data } = useReleases(ReleasesFeed.FrontEnd); - const { APP_VERSION, VEGA_ENV, VEGA_NETWORKS } = useEnvironment(); - - const CANONICAL_URL = VEGA_NETWORKS[VEGA_ENV] || 'https://console.vega.xyz'; - - const newest = useMemo(() => { - if (!APP_VERSION || !data) return undefined; - const newer = data.filter((r) => gt(r.tagName, APP_VERSION)); - const valid = - // filter pre-releases on mainnet - VEGA_ENV === Networks.MAINNET - ? newer?.filter((r) => !prerelease(parseTagName(r.tagName))) - : newer; - return valid.sort((a, b) => (gt(a.tagName, b.tagName) ? -1 : 1))[0]; - }, [APP_VERSION, VEGA_ENV, data]); - - if (!visible || !newest) { - return null; - } - - return ( - { - setVisible(false); - }} - > -
- - {t('Upgrade to the latest version of Console')} - -
-
- - {t("View what's changed")} - {' '} - {t(' or bookmark')}{' '} - - {t('console.vega.xyz')} - {' '} - - - {' '} - {'to always see the latest version.'} -
-
- ); -}; diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index 188c9f889..d4795e933 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -38,7 +38,7 @@ import { AppLoader, DynamicLoader } from '../components/app-loader'; import { useDataProvider } from '@vegaprotocol/data-provider'; import { activeOrdersProvider } from '@vegaprotocol/orders'; import { useTelemetryApproval } from '../lib/hooks/use-telemetry-approval'; -import { AnnouncementBanner, UpgradeBanner } from '../components/banner'; +import { AnnouncementBanner } from '../components/banner'; import { Navbar } from '../components/navbar'; import classNames from 'classnames'; import { @@ -115,7 +115,6 @@ function AppBody({ Component }: AppProps) { /> -
diff --git a/package.json b/package.json index 0938cdf05..fbe0ca039 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "recharts": "^2.1.2", "recursive-key-filter": "^1.0.2", "regenerator-runtime": "0.13.7", - "semver": "^7.5.1", "toml": "^3.0.0", "tslib": "^2.3.0", "uuid": "^8.3.2", diff --git a/yarn.lock b/yarn.lock index 9c0a29346..47964beb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22591,13 +22591,6 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.5.1: - version "7.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" - integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== - dependencies: - lru-cache "^6.0.0" - semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"