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