@visns-studio/visns-components 2.6.10 → 2.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/crm/Form.jsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
2
3
|
import { motion } from 'framer-motion';
|
|
3
4
|
import { toast } from 'react-toastify';
|
|
4
5
|
import moment from 'moment';
|
|
@@ -21,6 +22,7 @@ function Form({
|
|
|
21
22
|
updateForm,
|
|
22
23
|
userProfile,
|
|
23
24
|
}) {
|
|
25
|
+
const navigate = useNavigate();
|
|
24
26
|
const [inputClass, setInputClass] = useState({});
|
|
25
27
|
const [formData, setFormData] = useState({});
|
|
26
28
|
const [fetchTrigger, setFetchTrigger] = useState(false);
|
|
@@ -520,6 +522,15 @@ function Form({
|
|
|
520
522
|
toast.success(
|
|
521
523
|
'Entry successfully saved into the system.'
|
|
522
524
|
);
|
|
525
|
+
|
|
526
|
+
if (
|
|
527
|
+
formSettings.hasOwnProperty('redirect') &&
|
|
528
|
+
formSettings.redirect &&
|
|
529
|
+
result.data &&
|
|
530
|
+
result.data.id
|
|
531
|
+
) {
|
|
532
|
+
navigate(formSettings.redirect + result.data.id);
|
|
533
|
+
}
|
|
523
534
|
} else {
|
|
524
535
|
toast.error(
|
|
525
536
|
<div>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Link,
|
|
2
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
3
3
|
import Reveal from 'react-reveal/Reveal';
|
|
4
4
|
import { toast } from 'react-toastify';
|
|
5
5
|
import { Person, LockOff } from 'akar-icons';
|
|
6
6
|
|
|
7
7
|
import CustomFetch from '../Fetch';
|
|
8
|
-
import { render } from 'react-dom';
|
|
9
8
|
|
|
10
9
|
const Login = ({ logo, providers, setSystemAuth, setUserProfile }) => {
|
|
11
10
|
const location = useLocation();
|
package/package.json
CHANGED