feat(navigation): plus in der mitte, mehr-seite und sammler-umschalter
Unten Start, Katalog, Sammlung, Wuensche und ein Plus mit allen Wegen zu einem neuen Set. Konto, Design und Stammdaten auf der Seite "Mehr" statt im Konto-Menue und in sieben Reitern. Bei mehreren Sammlern waehlt "Fuer wen?" in der Kopfzeile das Kind fuer die ganze App, gemerkt pro Geraet. Behebt nebenbei, dass Mitglieder die Stammdaten nicht erreichten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d578eac743
commit
d5ffcbae60
@@ -0,0 +1,24 @@
|
||||
import 'server-only';
|
||||
import { cookies } from 'next/headers';
|
||||
import { resolveCollectorId } from '@/lib/queries/collectors';
|
||||
|
||||
/**
|
||||
* Which collector the app is looking at.
|
||||
*
|
||||
* The switch in the header remembers the choice per device (cookie), so Max's
|
||||
* tablet opens on Max. A `?sammler=` in the URL still wins - shared links and
|
||||
* the back button keep working - and `?sammler=alle` shows everybody.
|
||||
*/
|
||||
|
||||
export const COLLECTOR_COOKIE = 'bricktrack-sammler';
|
||||
export const ALL_COLLECTORS = 'alle';
|
||||
|
||||
export async function storedCollectorId(): Promise<string | undefined> {
|
||||
return resolveCollectorId((await cookies()).get(COLLECTOR_COOKIE)?.value);
|
||||
}
|
||||
|
||||
export async function activeCollectorId(param: string | undefined): Promise<string | undefined> {
|
||||
if (param === ALL_COLLECTORS) return undefined;
|
||||
if (param) return resolveCollectorId(param);
|
||||
return storedCollectorId();
|
||||
}
|
||||
Reference in New Issue
Block a user