Skip to content

Commit

Permalink
fix: nano screens url params (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuliomir authored Sep 17, 2024
1 parent 32af51b commit 96d9d0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/screens/nano/BlueprintDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import React, { useEffect, useRef, useState } from 'react';
import hljs from 'highlight.js/lib/core';
import python from 'highlight.js/lib/languages/python';
import { useParams } from 'react-router-dom';
import Loading from '../../components/Loading';
import nanoApi from '../../api/nanoApi';

Expand All @@ -18,8 +19,8 @@ hljs.registerLanguage('python', python);
*
* @memberof Screens
*/
function BlueprintDetail(props) {
const blueprintId = props.match.params.blueprint_id;
function BlueprintDetail() {
const { blueprint_id: blueprintId } = useParams();

// blueprintInformation {Object | null} Blueprint information
const [blueprintInformation, setBlueprintInformation] = useState(null);
Expand Down
6 changes: 3 additions & 3 deletions src/screens/nano/NanoContractDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useEffect, useState } from 'react';
import hathorLib from '@hathor/wallet-lib';
import { Link } from 'react-router-dom';
import { Link, useParams } from 'react-router-dom';
import { useSelector } from 'react-redux';
import NanoContractHistory from '../../components/nano/NanoContractHistory';
import Loading from '../../components/Loading';
Expand All @@ -19,8 +19,8 @@ import txApi from '../../api/txApi';
*
* @memberof Screens
*/
function NanoContractDetail(props) {
const ncId = props.match.params.nc_id;
function NanoContractDetail() {
const { nc_id: ncId } = useParams();

// ncState {Object | null} Nano contract state
const [ncState, setNcState] = useState(null);
Expand Down

0 comments on commit 96d9d0d

Please sign in to comment.