()
| 9 | } |
| 10 | |
| 11 | export const useLayoutVariant = (): UseLayoutVariant => { |
| 12 | const { isAuthReady } = useAuthContext(); |
| 13 | // v2 chrome (rail, page-header strip, floating card) only renders at |
| 14 | // laptop+ — on tablet we still serve the legacy SidebarTablet and the |
| 15 | // legacy header. Gate evaluation on the same breakpoint so consumers |
| 16 | // can treat `isV2` as the single source of truth (no separate |
| 17 | // `useViewSize(ViewSize.Laptop)` check needed at the call site). |
| 18 | const isLaptop = useViewSize(ViewSize.Laptop); |
| 19 | const shouldEvaluate = isAuthReady && isLaptop; |
| 20 | const { value, isLoading } = useConditionalFeature({ |
| 21 | feature: featureLayoutV2, |
| 22 | shouldEvaluate, |
| 23 | }); |
| 24 | |
| 25 | return { |
| 26 | isV2: shouldEvaluate && value === true, |
| 27 | isLoading, |
| 28 | }; |
| 29 | }; |
no test coverage detected