Skip to content

Commit

Permalink
Use createMatchSelector selector in SendContainerWrapper component (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed Oct 19, 2021
1 parent 23cd6ea commit 1bd5534
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/frontend/src/components/send/SendContainerWrapper.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createMatchSelector } from 'connected-react-router';
import { utils } from 'near-api-js';
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
Expand All @@ -20,9 +21,9 @@ const { parseNearAmount, formatNearAmount } = utils.format;
const { fetchTokens } = tokensActions;

export function SendContainerWrapper({ match }) {
const accountIdFromUrl = match.params.accountId || '';
const dispatch = useDispatch();


const accountIdFromUrl = useSelector(createMatchSelector('/send-money/:accountId?'))?.params.accountId || '';
const accountId = useSelector((state) => selectAccountId(state));
const localAlert = useSelector((state) => selectStatusLocalAlert(state));
const nearTokenFiatValueUSD = useSelector((state) => selectNearTokenFiatValueUSD(state));
Expand Down

0 comments on commit 1bd5534

Please sign in to comment.