Devographics / Monorepo

Monorepo containing the State of JS apps
surveyform-sigma.vercel.app
Other
125 stars 50 forks source link

Access survey edition in top level nav #223

Closed eric-burel closed 1 year ago

eric-burel commented 1 year ago

Problem: Nav is in an upper layout, so we may not have an edition depending on the context

"Layouts do not have access to the current route segment(s). To access route segments, you can use useSelectedLayoutSegment or useSelectedLayoutSegments in a Client Component."

Of course, useSelectedLayoutSegments points to nothing :) But the idea is:

SachaG commented 1 year ago

Probably best to:

eric-burel commented 1 year ago

=> create a edition specific layout => create a non-specific layout and find a way to share between privacy policy and account (using "(foobar)" folders with parenthises I think, need to find the doc back)

eric-burel commented 1 year ago

https://nextjs.org/docs/app/building-your-application/routing/route-groups