-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow filtering for analytics page (frontend) #178
base: main
Are you sure you want to change the base?
Conversation
@jyo142 is attempting to deploy a commit to the Listinai Team on Vercel. A member of the Team first needs to authorize it. |
@nevo-david sorry for the very late PR! I have been pretty caught up with other life things :( |
const query = | ||
newState === 'none' ? `` : `?key=${param}&state=${newState}`; | ||
router.replace(`/analytics${query}`); | ||
const params = new URLSearchParams(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to use URLSearchParams to make it easier to manage the dynamic params
}, | ||
[state, param] | ||
[state, param, startDate, endDate] |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
); | ||
|
||
const changeState = useCallback(() => { | ||
changeStateUrl( | ||
state === 'none' ? 'desc' : state === 'desc' ? 'asc' : 'none' | ||
); | ||
}, [state, param]); | ||
}, [state, param, startDate, endDate]); |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
}, | ||
[page, key, state] | ||
[page, key, state, startDate, endDate] |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
@@ -0,0 +1,129 @@ | |||
import { FC, useCallback, useState } from 'react'; | |||
import dayjs from 'dayjs'; | |||
import { Calendar, RangeCalendar, TimeInput } from '@mantine/dates'; |
Check warning
Code scanning / ESLint
Disallow unused variables Warning
@@ -0,0 +1,129 @@ | |||
import { FC, useCallback, useState } from 'react'; | |||
import dayjs from 'dayjs'; | |||
import { Calendar, RangeCalendar, TimeInput } from '@mantine/dates'; |
Check warning
Code scanning / ESLint
Disallow unused variables Warning
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Allow filtering (frontend) for analytics page
Created a DateRangePicker component
The analytics component adds url parameters on change of the date range
Why was this change needed? (You can also link to an open issue here)
https://github.com/gitroomhq/gitroom/issues/147
Screen.Recording.2024-06-03.at.3.44.43.PM.mov