Skip to content
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

[CP Staging] Remove borderRadius from LHP & fix linkTo function #33359

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libs/Navigation/linkTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam

// If action type is different than NAVIGATE we can't change it to the PUSH safely
if (action?.type === CONST.NAVIGATION.ACTION_TYPE.NAVIGATE) {
const topRouteName = rootState.routes.at(-1)?.name;
const topRouteName = rootState?.routes?.at(-1)?.name;
const isTargetNavigatorOnTop = topRouteName === action.payload.name;

// In case if type is 'FORCED_UP' we replace current screen with the provided. This means the current screen no longer exists in the stack
Expand Down
20 changes: 10 additions & 10 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ const headlineFont = {
fontWeight: '500',
} satisfies TextStyle;

const modalNavigatorContainer = (isSmallScreenWidth: boolean) =>
({
position: 'absolute',
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
height: '100%',
} satisfies ViewStyle);

const webViewStyles = (theme: ThemeColors) =>
({
// As of react-native-render-html v6, don't declare distinct styles for
Expand Down Expand Up @@ -1406,21 +1413,14 @@ const styles = (theme: ThemeColors) =>

LHPNavigatorContainer: (isSmallScreenWidth: boolean) =>
({
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
position: 'absolute',
...modalNavigatorContainer(isSmallScreenWidth),
left: 0,
height: '100%',
borderTopRightRadius: isSmallScreenWidth ? 0 : variables.lhpBorderRadius,
borderBottomRightRadius: isSmallScreenWidth ? 0 : variables.lhpBorderRadius,
overflow: 'hidden',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this used for before and why is it not needed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop was necessary to make borderRadius visible. Without borderRadius we no longer need this property in the style object

} satisfies ViewStyle),

RHPNavigatorContainer: (isSmallScreenWidth: boolean) =>
({
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
position: 'absolute',
...modalNavigatorContainer(isSmallScreenWidth),
right: 0,
height: '100%',
} satisfies ViewStyle),

onlyEmojisText: {
Expand Down Expand Up @@ -1641,7 +1641,7 @@ const styles = (theme: ThemeColors) =>
...positioning.pFixed,
// We need to stretch the overlay to cover the sidebar and the translate animation distance.
// The overlay must also cover borderRadius of the LHP component
left: isModalOnTheLeft ? -variables.lhpBorderRadius : -2 * variables.sideBarWidth,
left: isModalOnTheLeft ? 0 : -2 * variables.sideBarWidth,
top: 0,
bottom: 0,
right: isModalOnTheLeft ? -2 * variables.sideBarWidth : 0,
Expand Down
2 changes: 0 additions & 2 deletions src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,4 @@ export default {
cardPreviewHeight: 148,
cardPreviewWidth: 235,
cardNameWidth: 156,

lhpBorderRadius: 24,
} as const;