fix: handle new optional parameter for settings_exchange_add page
This commit is contained in:
parent
f7cabbf479
commit
32cd54e11d
@ -67,9 +67,9 @@ export function useComponentState(
|
|||||||
const initialExchange =
|
const initialExchange =
|
||||||
foundExchangeForCurrency !== -1
|
foundExchangeForCurrency !== -1
|
||||||
? exchangeSelectList[foundExchangeForCurrency]
|
? exchangeSelectList[foundExchangeForCurrency]
|
||||||
: // : exchangeSelectList.length > 0
|
: !initialCurrency && exchangeSelectList.length > 0
|
||||||
// ? exchangeSelectList[0]
|
? exchangeSelectList[0]
|
||||||
undefined;
|
: undefined;
|
||||||
|
|
||||||
const [exchange, setExchange] = useState(initialExchange || "");
|
const [exchange, setExchange] = useState(initialExchange || "");
|
||||||
const [currency, setCurrency] = useState(
|
const [currency, setCurrency] = useState(
|
||||||
@ -188,7 +188,7 @@ export function CreateManualWithdraw({
|
|||||||
<i18n.Translate>No exchange configured</i18n.Translate>
|
<i18n.Translate>No exchange configured</i18n.Translate>
|
||||||
</BoldLight>
|
</BoldLight>
|
||||||
<LinkPrimary
|
<LinkPrimary
|
||||||
href={Pages.settings_exchange_add}
|
href={Pages.settings_exchange_add.replace(":currency?", "")}
|
||||||
style={{ marginLeft: "auto" }}
|
style={{ marginLeft: "auto" }}
|
||||||
>
|
>
|
||||||
<i18n.Translate>Add Exchange</i18n.Translate>
|
<i18n.Translate>Add Exchange</i18n.Translate>
|
||||||
@ -234,7 +234,7 @@ export function CreateManualWithdraw({
|
|||||||
</Input>
|
</Input>
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<LinkPrimary
|
<LinkPrimary
|
||||||
href={Pages.settings_exchange_add}
|
href={Pages.settings_exchange_add.replace(":currency?", "")}
|
||||||
style={{ marginLeft: "auto" }}
|
style={{ marginLeft: "auto" }}
|
||||||
>
|
>
|
||||||
<i18n.Translate>Add Exchange</i18n.Translate>
|
<i18n.Translate>Add Exchange</i18n.Translate>
|
||||||
|
@ -177,8 +177,7 @@ export function ExchangeSetUrlPage({
|
|||||||
disabled={
|
disabled={
|
||||||
!result ||
|
!result ||
|
||||||
!!error ||
|
!!error ||
|
||||||
(expectedCurrency !== undefined &&
|
(!!expectedCurrency && expectedCurrency !== result.currency)
|
||||||
expectedCurrency !== result.currency)
|
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const url = canonicalizeBaseUrl(endpoint);
|
const url = canonicalizeBaseUrl(endpoint);
|
||||||
|
@ -177,7 +177,9 @@ export function SettingsView({
|
|||||||
)}
|
)}
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div />
|
<div />
|
||||||
<LinkPrimary href={Pages.settings_exchange_add}>
|
<LinkPrimary
|
||||||
|
href={Pages.settings_exchange_add.replace(":currency?", "")}
|
||||||
|
>
|
||||||
<i18n.Translate>Add an exchange</i18n.Translate>
|
<i18n.Translate>Add an exchange</i18n.Translate>
|
||||||
</LinkPrimary>
|
</LinkPrimary>
|
||||||
</div>
|
</div>
|
||||||
|
@ -113,23 +113,23 @@ function Application(): VNode {
|
|||||||
<Fragment>
|
<Fragment>
|
||||||
<LogoHeader />
|
<LogoHeader />
|
||||||
<WalletNavBar path={path} />
|
<WalletNavBar path={path} />
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
backgroundColor: "lightcyan",
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PendingTransactions
|
||||||
|
goToTransaction={(txId: string) =>
|
||||||
|
route(Pages.balance_transaction.replace(":tid", txId))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Match>
|
</Match>
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundColor: "lightcyan",
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PendingTransactions
|
|
||||||
goToTransaction={(txId: string) =>
|
|
||||||
route(Pages.balance_transaction.replace(":tid", txId))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<WalletBox>
|
<WalletBox>
|
||||||
{globalNotification && (
|
{globalNotification && (
|
||||||
<SuccessBox onClick={clearNotification}>
|
<SuccessBox onClick={clearNotification}>
|
||||||
@ -166,7 +166,7 @@ function Application(): VNode {
|
|||||||
component={TransactionPage}
|
component={TransactionPage}
|
||||||
goToWalletHistory={(currency?: string) => {
|
goToWalletHistory={(currency?: string) => {
|
||||||
route(
|
route(
|
||||||
Pages.balance_history.replace(":currency", currency || ""),
|
Pages.balance_history.replace(":currency?", currency || ""),
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -183,10 +183,10 @@ function Application(): VNode {
|
|||||||
path={Pages.balance_deposit}
|
path={Pages.balance_deposit}
|
||||||
component={DepositPage}
|
component={DepositPage}
|
||||||
onCancel={(currency: string) => {
|
onCancel={(currency: string) => {
|
||||||
route(Pages.balance_history.replace(":currency", currency));
|
route(Pages.balance_history.replace(":currency?", currency));
|
||||||
}}
|
}}
|
||||||
onSuccess={(currency: string) => {
|
onSuccess={(currency: string) => {
|
||||||
route(Pages.balance_history.replace(":currency", currency));
|
route(Pages.balance_history.replace(":currency?", currency));
|
||||||
setGlobalNotification(
|
setGlobalNotification(
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
All done, your transaction is in progress
|
All done, your transaction is in progress
|
||||||
@ -268,13 +268,13 @@ function Application(): VNode {
|
|||||||
<Route
|
<Route
|
||||||
path={Pages.balance}
|
path={Pages.balance}
|
||||||
component={Redirect}
|
component={Redirect}
|
||||||
to={Pages.balance_history.replace(":currency", "")}
|
to={Pages.balance_history.replace(":currency?", "")}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
default
|
default
|
||||||
component={Redirect}
|
component={Redirect}
|
||||||
to={Pages.balance_history.replace(":currency", "")}
|
to={Pages.balance_history.replace(":currency?", "")}
|
||||||
/>
|
/>
|
||||||
</Router>
|
</Router>
|
||||||
</WalletBox>
|
</WalletBox>
|
||||||
|
Loading…
Reference in New Issue
Block a user