Skip to content

Commit

Permalink
drop sanchonet
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Oct 17, 2024
1 parent 944bf3f commit 3eafb93
Show file tree
Hide file tree
Showing 48 changed files with 1,104 additions and 1,718 deletions.
2 changes: 0 additions & 2 deletions apps/wallet-mobile/.storybook/storybook.requires.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ export const ProviderItem = ({onPress, fee, rightAdornment, leftAdornment, disab
const {orderType} = useExchange()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho
const isMainnet = network === Chain.Network.Mainnet
const isBuy = orderType === 'buy'

if ((isPreprod || isSancho) && isBuy) return null
if (isPreprod && isBuy) return null

return (
<>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {useShowBuyBannerSmall} from '../useShowBuyBannerSmall'
import {BuyBannerBig} from './BuyBannerBig'
import {BuyBannerSmall} from './BuyBannerSmall'
import {PreprodFaucetBanner} from './PreprodFaucetBanner'
import {SanchonetFaucetBanner} from './SanchonetFaucetBanner'

export const ShowBuyBanner = () => {
const {wallet} = useSelectedWallet()
Expand All @@ -33,9 +32,6 @@ export const ShowBuyBanner = () => {
case hasZeroPt && hasZeroTx && network === Chain.Network.Preprod:
banner = <PreprodFaucetBanner />
break
case hasZeroPt && hasZeroTx && network === Chain.Network.Sancho:
banner = <SanchonetFaucetBanner />
break
case hasZeroPt && hasZeroTx:
banner = <BuyBannerBig />
break
Expand Down
30 changes: 0 additions & 30 deletions apps/wallet-mobile/src/features/Exchange/common/useStrings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ export const useStrings = () => {
preprodFaucetBannerTitle: intl.formatMessage(messages.preprodFaucetBannerTitle),
preprodFaucetBannerText: intl.formatMessage(messages.preprodFaucetBannerText),
preprodFaucetBannerButtonText: intl.formatMessage(messages.preprodFaucetBannerButtonText),
sanchoFaucetBannerTitle: intl.formatMessage(messages.sanchoFaucetBannerTitle),
sanchoFaucetBannerText: intl.formatMessage(messages.sanchoFaucetBannerText),
sanchoFaucetBannerButtonText: intl.formatMessage(messages.sanchoFaucetBannerButtonText),
createOrderPreprodFaucetButtonText: intl.formatMessage(messages.createOrderPreprodFaucetButtonText),
createOrderPreprodNoticeTitle: intl.formatMessage(messages.createOrderPreprodNoticeTitle),
createOrderPreprodNoticeText: intl.formatMessage(messages.createOrderPreprodNoticeText),
createOrderSanchonetFaucetButtonText: intl.formatMessage(messages.createOrderSanchonetFaucetButtonText),
createOrderSanchonetNoticeTitle: intl.formatMessage(messages.createOrderSanchonetNoticeTitle),
createOrderSanchonetNoticeText: intl.formatMessage(messages.createOrderSanchonetNoticeText),
playground: intl.formatMessage(messages.playground),
close: intl.formatMessage(globalMessages.close),
error: intl.formatMessage(globalMessages.error),
Expand Down Expand Up @@ -188,18 +182,6 @@ const messages = Object.freeze(
id: 'rampOnOff.createRampOnOff.preprodfaucetbanner.button.text',
defaultMessage: '!!!Go to tada faucet',
},
sanchoFaucetBannerTitle: {
id: 'rampOnOff.createRampOnOff.sanchofaucetbanner.title',
defaultMessage: '!!!Learn Cardano with test ADA ⭐️',
},
sanchoFaucetBannerText: {
id: 'rampOnOff.createRampOnOff.sanchofaucetbanner.text',
defaultMessage: `!!!Get started with Cardano's test currency, TADA. It's your key to testing a new world of possibilities.`,
},
sanchoFaucetBannerButtonText: {
id: 'rampOnOff.createRampOnOff.sanchofaucetbanner.button.text',
defaultMessage: '!!!Go to tada faucet',
},
createOrderPreprodFaucetButtonText: {
id: 'rampOnOff.createRampOnOff.createorder.preprodfaucet.button.text',
defaultMessage: '!!!Add test ada',
Expand All @@ -212,18 +194,6 @@ const messages = Object.freeze(
id: 'rampOnOff.createRampOnOff.createorder.preprodnotice.text',
defaultMessage: '!!!Switch network or top up your testnet network wallet with the free Cardano faucet',
},
createOrderSanchonetFaucetButtonText: {
id: 'rampOnOff.createRampOnOff.createorder.sanchofaucet.button.text',
defaultMessage: '!!!Add test ada',
},
createOrderSanchonetNoticeTitle: {
id: 'rampOnOff.createRampOnOff.createorder.sanchonotice.title',
defaultMessage: '!!!ADA purchases can only be made on the mainnet',
},
createOrderSanchonetNoticeText: {
id: 'rampOnOff.createRampOnOff.createorder.sanchonotice.text',
defaultMessage: '!!!Switch network or top up your testnet network wallet with the free Cardano faucet',
},
playground: {
id: 'rampOnOff.createRampOnOff.createorder.playground',
defaultMessage: '!!!Playground',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,16 @@ export const CreateExchangeButton = ({
} = useWalletManager()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho
const isBuy = orderType === 'buy'

const title = isBuy
? isPreprod
? strings.createOrderPreprodFaucetButtonText
: isSancho
? strings.createOrderSanchonetFaucetButtonText
: strings.proceed
: strings.proceed
const title = isBuy ? (isPreprod ? strings.createOrderPreprodFaucetButtonText : strings.proceed) : strings.proceed

const handleOnPress = () => {
if (isPreprod && isBuy) {
handleOnPressOnPreprod()
return
}

if (isSancho && isBuy) {
handleOnPressOnSanchonet()
return
}

onPress()
}

Expand All @@ -61,10 +49,6 @@ const handleOnPressOnPreprod = () => {
Linking.openURL('https://docs.cardano.org/cardano-testnets/tools/faucet/')
}

const handleOnPressOnSanchonet = () => {
Linking.openURL('https://sancho.network/faucet/')
}

const useStyles = () => {
const {atoms} = useTheme()
const styles = StyleSheet.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@ export const CreateExchangeOrderScreen = () => {

// on Preprod it launches the faucet when buying
// selling is enabled for both and launch the sandbox
const isSancho = network === Chain.Network.Sancho
const isPreprod = network === Chain.Network.Preprod
const isBlocked = isSancho && orderType === 'buy'
const exchangeDisabled = isLoading || (wallet.isMainnet && !canExchange) || isBlocked
const exchangeDisabled = isLoading || (wallet.isMainnet && !canExchange)

const feeText = (isPreprod || isSancho) && orderType === 'sell' ? strings.playground : `${fee}% ${strings.fee}`
const feeText = isPreprod && orderType === 'sell' ? strings.playground : `${fee}% ${strings.fee}`

return (
<KeyboardAvoidingView style={styles.root}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const EditAmount = ({disabled}: {disabled?: boolean}) => {
} = useWalletManager()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho

const {wallet} = useSelectedWallet()
const balance = usePortfolioPrimaryBalance({wallet})
Expand Down Expand Up @@ -72,7 +71,7 @@ export const EditAmount = ({disabled}: {disabled?: boolean}) => {
],
)

if (isPreprod || isSancho) return null
if (isPreprod) return null

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ export const ShowDisclaimer = () => {
const {orderType} = useExchange()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho

if ((isPreprod || isSancho) && orderType === 'buy') return null
if (isPreprod && orderType === 'buy') return null

const contentDisclaimer =
(isPreprod || isSancho) && orderType === 'sell' ? strings.contentDisclaimerPreprod : strings.contentDisclaimer
isPreprod && orderType === 'sell' ? strings.contentDisclaimerPreprod : strings.contentDisclaimer

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ export const ShowPreprodNotice = () => {
const {orderType} = useExchange()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho

if ((isPreprod || isSancho) && orderType === 'buy')
if (isPreprod && orderType === 'buy')
return (
<View style={styles.container}>
<Space height="_2xl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@ const buildPortfolioTokenManager = ({network}: {network: Chain.SupportedNetworks
export const buildPortfolioTokenManagers = () => {
const mainnetPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Mainnet})
const preprodPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Preprod})
const sanchoPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Sancho})
const previewPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Preview})

const tokenManagers: Readonly<{
[Chain.Network.Mainnet]: Portfolio.Manager.Token
[Chain.Network.Preprod]: Portfolio.Manager.Token
[Chain.Network.Sancho]: Portfolio.Manager.Token
[Chain.Network.Preview]: Portfolio.Manager.Token
}> = freeze(
{
[Chain.Network.Mainnet]: mainnetPortfolioTokenManager.tokenManager,
[Chain.Network.Preprod]: preprodPortfolioTokenManager.tokenManager,
[Chain.Network.Sancho]: sanchoPortfolioTokenManager.tokenManager,
[Chain.Network.Preview]: previewPortfolioTokenManager.tokenManager,
},
true,
Expand All @@ -49,13 +46,11 @@ export const buildPortfolioTokenManagers = () => {
const tokenStorages: Readonly<{
[Chain.Network.Mainnet]: App.Storage<false, Portfolio.Token.Id>
[Chain.Network.Preprod]: App.Storage<false, Portfolio.Token.Id>
[Chain.Network.Sancho]: App.Storage<false, Portfolio.Token.Id>
[Chain.Network.Preview]: App.Storage<false, Portfolio.Token.Id>
}> = freeze(
{
[Chain.Network.Mainnet]: mainnetPortfolioTokenManager.storage,
[Chain.Network.Preprod]: preprodPortfolioTokenManager.storage,
[Chain.Network.Sancho]: sanchoPortfolioTokenManager.storage,
[Chain.Network.Preview]: previewPortfolioTokenManager.storage,
},
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ export const useNavigateTo = () => {
navigation.navigate('history', {
screen: 'swap-preprod-notice',
}),
swapSanchoNotice: () =>
navigation.navigate('history', {
screen: 'swap-sancho-notice',
}),
buyAda: () => navigation.navigate('history', {screen: 'exchange-create-order'}),
} as const).current
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {FlatList, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View}
import {Icon} from '../../../../../components/Icon'
import {Spacer} from '../../../../../components/Spacer/Spacer'
import {PreprodFaucetBanner} from '../../../../Exchange/common/ShowBuyBanner/PreprodFaucetBanner'
import {SanchonetFaucetBanner} from '../../../../Exchange/common/ShowBuyBanner/SanchonetFaucetBanner'
import {useSelectedWallet} from '../../../../WalletManager/common/hooks/useSelectedWallet'
import {useWalletManager} from '../../../../WalletManager/context/WalletManagerProvider'
import {useNavigateTo} from '../../../common/hooks/useNavigateTo'
Expand All @@ -29,7 +28,6 @@ export const DashboardTokensList = () => {
} = useWalletManager()

const isPreprod = network === Chain.Network.Preprod
const isSancho = network === Chain.Network.Sancho

const tokensList = React.useMemo(() => balances.fts ?? [], [balances.fts])
const isJustADA = React.useMemo(() => {
Expand All @@ -47,11 +45,7 @@ export const DashboardTokensList = () => {

const renderTokensList = () => {
if (isZeroADABalance) {
return (
<View style={styles.container}>
{isPreprod ? <PreprodFaucetBanner /> : isSancho ? <SanchonetFaucetBanner /> : <BuyADABanner />}
</View>
)
return <View style={styles.container}>{isPreprod ? <PreprodFaucetBanner /> : <BuyADABanner />}</View>
}

if (isJustADA) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const Actions = ({tokenInfo}: Props) => {

const handleOnSwap = () => {
if (network === Chain.Network.Preprod) return navigateTo.swapPreprodNotice()
if (network === Chain.Network.Sancho) return navigateTo.swapSanchoNotice()

swapForm.resetSwapForm()

Expand Down
Loading

0 comments on commit 3eafb93

Please sign in to comment.