Skip to content

Commit

Permalink
Refactor, implementation of DataTables and restyle of multiple pages (#…
Browse files Browse the repository at this point in the history
…1617)

* wip(1584): Subscribers refactored, created generic hook for data tables and changed approach how data is handled in tables

* wip: groups and subscriber tables refactored

* feat: completed table restyle and refactor

* feat: completed campaings table restyle and refactor

* fix: fixed typo in subscribers header
  • Loading branch information
drakulovski authored Feb 6, 2022
1 parent 1a57319 commit 48afb6a
Show file tree
Hide file tree
Showing 28 changed files with 1,088 additions and 1,240 deletions.
3 changes: 2 additions & 1 deletion dashboard/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"plugins": ["react"],
"rules": {
"react/state-in-constructor": [1, "always"]
"react/state-in-constructor": [1, "always"],
"react/prop-types": 0
},
"settings": {
"react": {
Expand Down
2 changes: 2 additions & 0 deletions dashboard/local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_ENABLE_SOCIAL_AUTH=true
REACT_APP_RECAPTCHA_SITE_KEY=
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"yup": "^0.32.9"
},
"scripts": {
"start": "react-scripts start",
"start": "set HTTPS=false && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down
27 changes: 27 additions & 0 deletions dashboard/src/hooks/useCallApiDataTable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useApi } from "./"

export const useCallApiDataTable = (endpoint) => {
const [state, callApi] = useApi(
{
url: endpoint,
},
{
collection: [],
init: true,
}
)

const onClickPrev = () => {
callApi({
url: state.data.links.previous,
})
}

const onClickNext = () => {
callApi({
url: state.data.links.next,
})
}

return [callApi, state, onClickPrev, onClickNext]
}
Loading

0 comments on commit 48afb6a

Please sign in to comment.