(pathname: string)
| 71 | // squads; Explore for search and the tag, source and leaderboard |
| 72 | // directories. |
| 73 | export const owningRoot = (pathname: string): ShellRoot => { |
| 74 | const path = withoutLayoutVariantPrefix(pathname ?? ''); |
| 75 | |
| 76 | if (path.startsWith('/squads')) { |
| 77 | return ShellRoot.Squads; |
| 78 | } |
| 79 | if (path.startsWith('/notifications')) { |
| 80 | return ShellRoot.Activity; |
| 81 | } |
| 82 | if ( |
| 83 | isRootView(ShellRoot.Explore, path) || |
| 84 | exploreLeafPrefixes.some((prefix) => path.startsWith(prefix)) |
| 85 | ) { |
| 86 | return ShellRoot.Explore; |
| 87 | } |
| 88 | if (path.startsWith('/posts/')) { |
| 89 | return ShellRoot.Home; |
| 90 | } |
| 91 | if ( |
| 92 | explorePrefixes.some( |
| 93 | (prefix) => path === prefix || path.startsWith(`${prefix}/`), |
| 94 | ) |
| 95 | ) { |
| 96 | return ShellRoot.Explore; |
| 97 | } |
| 98 | |
| 99 | return ShellRoot.Home; |
| 100 | }; |
| 101 | |
| 102 | const noClusterPrefixes = [ |
| 103 | // You is a menu, not a place to browse from; back is its one way out. |
no test coverage detected