We have 5 components into this library
-
Users
-
AddUsers
-
Dashboard
-
Call activity
-
Logs
npm install git+ssh://git@github.com:ranjith29v/blinkin-admin-panel.git
or add as dependency in your package.json file
"blinkin-admin-panel": "github:wardhanster/blinkin-admin-panel.git#<Commit of your build in master branch>"
This package is a standalone package. So you have to install this inside a dummy project for development.
-
Unzip and install packages for dummy app.
-
Goto src directory of dummy project.
-
Clone current project inside /src directory of dummy project. Now /src should look like /src/blinkin-admin-panel .
-
Import componet which you have to work in App.js eg.
import { Users } from './blinkin-admin-panel/src'
-
Import required methods for that components from /non-native-dependencies/services/adminStore directory or from /non-native-dependencies/services/userStore depending upon the required prop.
-
Fetch latest user token from main BlinkIn app with proper authentication for accessing admin module. Update token direcly inside /non-native-dependencies/services .
-
If there is any methods missing in /non-native-dependencies/services, make sure copy them from main BlinkIn app services into dummy app services.
-
Goto /src/blinkin-admin-panel directory of dummy app.
-
Make sure react and react-dom version sync with main BlinkIn app.
-
If dependencies are in proper version, run
npm run build
to build your code. -
After successfully building the code, commit your code and push to remote repo.
-
Copy full commit hash of your latest push on GitHub and use that in main Blinkin package.json for pulling latest build.
import { Users } from 'blinkin-admin-panel';
<Users
fetchAPI={fetchAPI}
fetchUserById={fetchUserById}
updateUserData={updateUserData}
deleteUsers={deleteUsers}
/>
import { AddUsers } from 'blinkin-admin-panel';
<AddUsers
handleSingleUserAPI={handleSingleUserAPI}
handleBulkUploadFile={handleBulkUploadFile}
/>
Add Users prop handling details
Note : Am using axios to test since we need to handle two things 1. progess percentage 2. On success message
import { Dashboard } from 'blinkin-admin-panel';
<Dashboard fetchData={fetchData} fetchUserData={fetchUserData} />
Dashboard prop handling details
import { CallActivity } from 'blinkin-admin-panel';
<CallActivity
getAPI={getCallActivityAPI}
filteringAPI={filteringCallActivityAPI}
/>
Call activity prop handling details
import { Logs } from 'blinkin-admin-panel';
<Logs getAPI={getLogsAPI} filteringAPI={filteringLogsAPI} />