edit overflow: hidden
This commit is contained in:
@@ -17,3 +17,26 @@ export function loginRouteWithRedirect(redirectPath: string) {
|
||||
query: { redirect: redirectPath },
|
||||
};
|
||||
}
|
||||
|
||||
export function businessBookingPath(businessId: string, hash?: string) {
|
||||
const normalizedHash = hash?.replace(/^#/, '');
|
||||
const base = `/app/businesses/${businessId}`;
|
||||
return normalizedHash ? `${base}#${normalizedHash}` : base;
|
||||
}
|
||||
|
||||
export function bookingDestination(
|
||||
businessId: string,
|
||||
isLoggedIn: boolean,
|
||||
hash?: string,
|
||||
) {
|
||||
if (!isLoggedIn) {
|
||||
return loginRouteWithRedirect(businessBookingPath(businessId, hash));
|
||||
}
|
||||
|
||||
const normalizedHash = hash?.replace(/^#/, '');
|
||||
return {
|
||||
name: 'app-business-detail' as const,
|
||||
params: { id: businessId },
|
||||
...(normalizedHash ? { hash: normalizedHash } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user