RizkyRajitha / linkin

Linkin is a customizable self hosted link tree platform.
https://linkindemo.vercel.app/
MIT License
78 stars 22 forks source link

show active form based on url query parameter #40

Closed RizkyRajitha closed 2 years ago

RizkyRajitha commented 2 years ago

update the current viewing form form in the url query parameter tab

ex - http://localhost:3000/dashboard?tab=genaralForm should display the genaralForm

query parameter can be obtained using next router https://nextjs.org/docs/api-reference/next/router https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L28

write an useEffect function to extract the query parameter from next router and update the active from using setactiveForm method https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L30

push the active path to the next router for all the forms

ex - router.push("/dashboard?tab=genaralForm"); in bellow click handlers

https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L161 https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L172 https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L183 https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L194 https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/formwrapper.js#L205

Honey-9 commented 2 years ago

can you assign this issue to me

RizkyRajitha commented 2 years ago

@Honey-9 issue is assigned . try to update your progress so that i can know this issue is not stale

Honey-9 commented 2 years ago

okk

RizkyRajitha commented 2 years ago

@Honey-9 sorry this issue has been resolved by #49 pr. you can make another pr if you wish by finding and fixing a bug .