diff --git a/src/components/Registration.css b/src/components/Registration.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Registration.js b/src/components/Registration.js new file mode 100644 index 0000000..040cbce --- /dev/null +++ b/src/components/Registration.js @@ -0,0 +1,64 @@ +import React, { useState } from 'react'; +import moment from 'moment'; +import axios from 'axios'; + +import './ExportData.css'; + +function Registration() { + const [userId, setUserId] = useState("2808202300103ROOBHO"); + const [counter, setCounter] = useState(0); + + const createUser = () => { + const id = moment().unix() + counter + "ROOBHO"; + setCounter(counter + 1); + axios({ + method: 'post', + url: "https://asia-south1-hpos-af3cc.cloudfunctions.net/registerUser", + data: { + "_id": id, + "aadharId": "2808202300001", + "abhaId": "12434949797979", + "birthYear": "2000", + "bloodGroup": "", + "careOf": "", + "caste": "", + "city": "Bengaluru", + "district": "Bengaluru", + "gender": "Male", + "house": "42", + "maritalStatus": "Single", + "name": "Web", + "phoneNumber": "9123456789", + "pinCode": "560060", + "registeredBy": "admin", + "registrationCenterName": "SMI", + "sickleCellHistory": null, + "state": "Karnataka", + "subCaste": "", + "testStatus": false, + "underMedication": false, + "underTransfusion": false, + "userImageURL": "https://hpos-prod.web.app/logo.png" + }, + withCredentials: false, + secure: false, + headers: { + "Content-Type": "application/json", + "x-client": "e16a1bd15af2ee640f5a7a18c8d8333f5f01f7c66e003bbc21ee52870f1bce27", + }, + }) + .then(response => response.data) + .then((data) => { + console.log(data); + }); + } + + return ( +
+
+
createUser()}>Create User
+
+
+ ); +} +export default Registration; \ No newline at end of file diff --git a/src/components/TestAnalyticsGraph.js b/src/components/TestAnalyticsGraph.js index 5feaa3f..9d7218a 100644 --- a/src/components/TestAnalyticsGraph.js +++ b/src/components/TestAnalyticsGraph.js @@ -26,7 +26,7 @@ class TestAnalyticsGraph extends Component { data.reverse(); var margin = { top: 30, right: 20, bottom: 50, left: 15 }, - width = 850 - margin.left - margin.right, + width = 1500 - margin.left - margin.right, height = 180 - margin.top - margin.bottom; var svg = d3.select("#tests-count-graph").append('svg') diff --git a/src/routes/appRoutes.js b/src/routes/appRoutes.js index f3c1253..0552f75 100644 --- a/src/routes/appRoutes.js +++ b/src/routes/appRoutes.js @@ -6,6 +6,8 @@ import HomePage from '../components/HomePage'; import Devices from '../components/Devices'; import { Download } from '@mui/icons-material'; import ExportData from '../components/ExportData'; +import Registration from '../components/Registration'; +import { FaUser } from 'react-icons/fa'; const appRoutes = [ { @@ -32,14 +34,23 @@ const appRoutes = [ } }, { - path: "/hposdata", + path: "/downloaddata", element: , - state: "hposdata", + state: "downloaddata", sidebarProps: { displayText: "Data Download", icon: } }, + { + path: "/registration", + element: , + state: "registration", + sidebarProps: { + displayText: "Registration", + icon: + } + }, ] export default appRoutes; \ No newline at end of file