Skip to content

Commit

Permalink
Merge pull request #33359 from software-mansion-labs/lhp-remove-borde…
Browse files Browse the repository at this point in the history
…r-radius

(cherry picked from commit 348e8ae)
  • Loading branch information
mountiny authored and OSBotify committed Dec 20, 2023
1 parent 3cc9e8e commit cba05ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
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',
} 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;

0 comments on commit cba05ce

Please sign in to comment.