namirasoft-account-react
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -10,2 +10,3 @@ "use strict"; | ||
const namirasoft_account_1 = require("namirasoft-account"); | ||
const react_router_dom_1 = require("react-router-dom"); | ||
const axios_1 = __importDefault(require("axios")); | ||
@@ -68,2 +69,3 @@ class RouterMaker { | ||
getQuery(name) { | ||
const location = (0, react_router_dom_1.useLocation)(); | ||
let query = query_string_1.default.parse(location.search); | ||
@@ -76,2 +78,3 @@ let item = query[name]; | ||
customQuery = {}; | ||
const location = (0, react_router_dom_1.useLocation)(); | ||
let query = query_string_1.default.parse(location.search); | ||
@@ -82,3 +85,5 @@ let final = Object.assign(Object.assign({}, query), customQuery); | ||
redirect(sub, customQuery) { | ||
console.log({ sub, customQuery }); | ||
const navigate = (0, react_router_dom_1.useNavigate)(); | ||
let ans = this.getLink(sub, customQuery); | ||
navigate(ans); | ||
} | ||
@@ -85,0 +90,0 @@ onComponentDidMount() { |
@@ -11,3 +11,3 @@ { | ||
"private": false, | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"main": "./dist/index.js", | ||
@@ -17,7 +17,9 @@ "types": "./dist/index.d.ts", | ||
"license": "MIT", | ||
"scripts": {}, | ||
"scripts": { | ||
"build": "" | ||
}, | ||
"dependencies": { | ||
"@types/react": "^18.2.66", | ||
"namirasoft-account": "^1.3.0", | ||
"namirasoft-core": "^1.3.0", | ||
"@types/react": "^18.2.70", | ||
"namirasoft-account": "^1.3.7", | ||
"namirasoft-core": "^1.3.11", | ||
"query-string": "^9.0.0", | ||
@@ -24,0 +26,0 @@ "react": "^18.2.0", |
@@ -10,24 +10,11 @@ | ||
import { IRouterMaker } from "./IRouterMaker"; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
import axios from "axios"; | ||
// todo | ||
// import { RouteComponentProps } from 'react-router-dom'; | ||
// todo | ||
// interface IProps extends RouteComponentProps | ||
// { | ||
// } | ||
export default class RouterMaker | ||
{ | ||
private component: IRouterStateChanger & IRouterMaker; | ||
// todo | ||
// private props: IProps; | ||
constructor(component: IRouterStateChanger & IRouterMaker | ||
// todo | ||
// , props: IProps | ||
) | ||
constructor(component: IRouterStateChanger & IRouterMaker) | ||
{ | ||
this.component = component; | ||
// todo | ||
// this.props = props; | ||
this.init = this.init.bind(this); | ||
@@ -78,4 +65,2 @@ this.getQuery = this.getQuery.bind(this); | ||
getQuery: this.getQuery, | ||
// todo | ||
// ...this.props | ||
}, | ||
@@ -91,3 +76,3 @@ messenger, | ||
{ | ||
// todo fix location. | ||
const location = useLocation(); | ||
let query = queryString.parse(location.search); | ||
@@ -101,3 +86,3 @@ let item = query[name]; | ||
customQuery = {}; | ||
// todo fix location. | ||
const location = useLocation(); | ||
let query = queryString.parse(location.search); | ||
@@ -109,7 +94,5 @@ let final = { ...query, ...customQuery }; | ||
{ | ||
// todo fix location. | ||
console.log({ sub, customQuery }); | ||
// let ans = this.getLink(sub, customQuery); | ||
// const { history } = this.props; | ||
// history.push(ans); | ||
const navigate = useNavigate(); | ||
let ans = this.getLink(sub, customQuery); | ||
navigate(ans); | ||
} | ||
@@ -116,0 +99,0 @@ onComponentDidMount(): void |
Sorry, the diff of this file is not supported yet
138586
597
Updated@types/react@^18.2.70
Updatednamirasoft-account@^1.3.7
Updatednamirasoft-core@^1.3.11