diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index 06c30ad..e73f2a3 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -23,7 +23,7 @@ const Profile = observer (() => { seed: Math.floor(Math.random() * 90000000000000000000) }; - const initialPropertyValues = ['First name', 'Second name', 'Birthdate', 'Gender', 'Residence', 'Document type', 'Document ID', 'Issue date', 'Expiry date']; + const initialPropertyValues = ['First name', 'Second name', 'Birthdate', 'Gender', 'National doctype', 'National doc id', 'National doc issue date', 'National doc expiry date']; const [propertyValues, setPropertyValues] = useState([]); const [updatedValues, setUpdatedValues] = useState([defaultValues]); const [addedValues, setAddedValues] = useState(defaultValues); @@ -43,7 +43,6 @@ const Profile = observer (() => { ...prevState, [field]: +value, })) - console.log(addedValues); }; const changeUpdatedValues = (value, field, key) => { @@ -59,7 +58,6 @@ const Profile = observer (() => { } : elem )) ) - console.log(updatedValues); }; const closeHint = (element) => { @@ -113,7 +111,7 @@ const Profile = observer (() => { const deleteDataParameters = () => { const changeData = userDataStore.decryptedData.filter(item=>!selectedItems.includes(item.key)) - registrationStore.pushAccountData(changeData) + registrationStore.pushAccountData(changeData); } const changeDataParameters = () => { @@ -135,12 +133,12 @@ const Profile = observer (() => { }) return newArr })(); - console.log(updatedData); + registrationStore.pushAccountData(updatedData); } const addDataParameters = () => { - addedValues.label = addedValues.label.toLowerCase().split(' ').join('_'); - console.log(registrationStore.userData.data.concat(addedValues)); + addedValues.key = addedValues.label.toLowerCase().split(' ').join('_'); + registrationStore.pushAccountData(userDataStore.decryptedData.concat(addedValues)); } const cancelAddPanel = () => { @@ -162,7 +160,6 @@ const Profile = observer (() => { const openUpdatePanel = () => { setUpdatePanelOpen(true); setChangePanelOpen(false); - console.log(updatedValues); } const applyDataDeletion = () => { @@ -312,51 +309,48 @@ const Profile = observer (() => { {/* Update panel */}
{updatedValues.map((item, index) => ( -
- -
- - changeUpdatedValues(e.target.value, 'label', item.key)} - value={item.label} - disabled='disabled' - /> -
-
- - changeUpdatedValues(e.target.value, 'value', item.key)} - value={item.value} - /> -
-
- - changeUpdatedValues(e.target.value, 'seed', item.key)} - value={item.seed} - /> -
- {(updatedValues[index+1]) ? ( -
- ) : null} +
+
+ + changeUpdatedValues(e.target.value, 'label', item.key)} + value={item.label} + disabled='disabled' + />
- +
+ + changeUpdatedValues(e.target.value, 'value', item.key)} + value={item.value} + /> +
+
+ + changeUpdatedValues(e.target.value, 'seed', item.key)} + value={item.seed} + /> +
+ {(updatedValues[index+1]) ? ( +
+ ) : null} +
))} -
Store data on blockchain
diff --git a/src/partials/digitalId/ProfileTable.jsx b/src/partials/digitalId/ProfileTable.jsx index 6d09e44..239d3ab 100644 --- a/src/partials/digitalId/ProfileTable.jsx +++ b/src/partials/digitalId/ProfileTable.jsx @@ -31,13 +31,13 @@ function ProfileTable({ const data = { general:["First name","Second name", "Gender", "Birthdate", "Place of birth"], - nationality:["Nationality", "National id", "National doctype", "National doc id", "National doc issue date", "National doc expiry date"], + nationality:["Nationality", "National ID", "National doctype", "National doc ID", "National doc issue date", "National doc expiry date"], social:["Telephone", "Twitter", "Facebook", "Instagram", "Youtube", "Wechat", "Tiktok", "Linkedin", "Vk", "Github", "Telegram", "Qq", "Snapchat", "Reddit"] } const generalData = userData.filter(elem => data.general.includes(elem.label)), nationalityData = userData.filter(elem => data.nationality.includes(elem.label)), - sosialData = userData.filter(elem => data.nationality.includes(elem.label)), + sosialData = userData.filter(elem => data.social.includes(elem.label)), otherData = userData.filter((elem) => !data.general.includes(elem.label) && !data.nationality.includes(elem.label) && !data.social.includes(elem.label)); diff --git a/src/store/userDataStore.js b/src/store/userDataStore.js index d0c7dfc..265f8e3 100644 --- a/src/store/userDataStore.js +++ b/src/store/userDataStore.js @@ -9,9 +9,9 @@ const labelMap = { birthdate: "Birthdate", place_of_birth: "Place of birth", nationality: "Nationality", - national_id: "National id", + national_id: "National ID", national_doctype: "National doctype", - national_doc_id: "National doc id", + national_doc_id: "National doc ID", national_doc_issue_date: "National doc issue date", national_doc_expiry_date: "National doc expiry date", telephone: "Telephone",