Repository navigation
fix(clients): drop the T3 Code wordmark from the sidebar and mobile headers #26906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Igor-Abramkin
wants to merge
3
commits into
pingdotgg:main
from
Igor-Abramkin:fix/clients-drop-header-wordmark
+120
−218
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
e4c1c03
fix(clients): drop the T3 Code wordmark from the sidebar and mobile h…
Igor-Abramkin 44bd426
fix(mobile): keep an accessible screen heading in the header
Igor-Abramkin 18667a1
fix(mobile): give the empty release heading a touch-sized frame
Igor-Abramkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import { NATIVE_WORKSPACE_COLUMNS_SUPPORTED } from "../native/NativeWorkspaceColumns"; | ||
| import Constants from "expo-constants"; | ||
| import type { NativeStackNavigationOptions } from "@react-navigation/native-stack"; | ||
| import { Platform, View } from "react-native"; | ||
|
|
||
| import { AppText as Text } from "./ui/AppText"; | ||
| import { IPAD_HOME_TITLE_OFFSET } from "../lib/layoutMetrics"; | ||
| import { resolveMobileStageLabel } from "../lib/mobileBranding"; | ||
| import { useAndroidControlSizing } from "./ui/useAndroidControlSizing"; | ||
|
|
||
| const BADGE_MAX_FONT_SCALE = 1.4; | ||
|
|
||
| export function headerTitleOffset(): number { | ||
| if (Platform.OS !== "ios") return 0; | ||
| return Platform.isPad && !NATIVE_WORKSPACE_COLUMNS_SUPPORTED ? IPAD_HOME_TITLE_OFFSET : 0; | ||
| } | ||
|
|
||
| /** | ||
| * The header's screen heading, visible only as the Dev or Nightly badge. Release builds still | ||
| * render this view: without it the native header falls back to its plain-text title. | ||
| */ | ||
| export function HeaderStageBadge(props: { | ||
| readonly screenTitle: string; | ||
| readonly allowFontScaling?: boolean; | ||
| }) { | ||
| const stageLabel = resolveMobileStageLabel(Constants.expoConfig?.extra?.appVariant); | ||
| const { scale } = useAndroidControlSizing(); | ||
|
|
||
| return ( | ||
| <View | ||
| aria-level={1} | ||
| accessibilityLabel={ | ||
| stageLabel === null ? props.screenTitle : `${props.screenTitle}, ${stageLabel} build` | ||
| } | ||
| accessible | ||
| role="heading" | ||
| // Release builds draw nothing here; the frame still gives touch exploration a target. | ||
| className={stageLabel === null ? "h-11 w-24 self-start" : "self-start"} | ||
| style={{ marginLeft: headerTitleOffset() }} | ||
| > | ||
| {stageLabel === null ? null : ( | ||
| <View | ||
| className="rounded-full bg-subtle px-1.5 py-0.5" | ||
| style={ | ||
| Platform.OS === "android" | ||
| ? { paddingHorizontal: 5.25 * scale, paddingVertical: 1.75 * scale } | ||
| : undefined | ||
| } | ||
| > | ||
| <Text | ||
| allowFontScaling={props.allowFontScaling} | ||
| maxFontSizeMultiplier={BADGE_MAX_FONT_SCALE} | ||
| className="font-t3-bold text-foreground-muted uppercase" | ||
| style={{ fontSize: 9 * scale, letterSpacing: 0.9 * scale }} | ||
| > | ||
| {stageLabel} | ||
| </Text> | ||
| </View> | ||
| )} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const THREADS_TITLE = "Threads"; | ||
|
|
||
| function renderHeaderStageBadge() { | ||
| return <HeaderStageBadge allowFontScaling={Platform.OS === "ios"} screenTitle={THREADS_TITLE} />; | ||
| } | ||
|
|
||
| export function getStageBadgeHeaderOptions( | ||
| fallbackTitleStyle?: NativeStackNavigationOptions["headerTitleStyle"], | ||
| ): NativeStackNavigationOptions { | ||
| return { | ||
| headerTitle: renderHeaderStageBadge, | ||
| headerTitleStyle: fallbackTitleStyle, | ||
| title: THREADS_TITLE, | ||
| unstable_headerLeftItems: undefined, | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| export type MobileStageLabel = "Beta" | "Dev" | "Nightly"; | ||
| export type MobileStageLabel = "Dev" | "Nightly"; | ||
|
|
||
| export function resolveMobileStageLabel(appVariant: unknown): MobileStageLabel { | ||
| export function resolveMobileStageLabel(appVariant: unknown): MobileStageLabel | null { | ||
| if (appVariant === "development") return "Dev"; | ||
| if (appVariant === "preview") return "Nightly"; | ||
| return "Beta"; | ||
| return null; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.