From 6a610a956f01f686aa398d9f485de321eeb2be62 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 8 Sep 2023 10:51:12 -0300 Subject: [PATCH] feat: Remove landscape support from smartphones (#5203) --- .../__snapshots__/RoomHeader.stories.storyshot | 2 -- .../IncomingCallNotification/index.tsx | 9 ++------- .../InAppNotification/NotifierComponent.tsx | 5 +---- app/containers/MessageActions/Header.tsx | 5 ++--- app/containers/Passcode/Base/index.tsx | 16 +--------------- app/containers/ReactionsList/ReactionsTabBar.tsx | 6 ++---- app/containers/RoomHeader/RoomHeader.stories.tsx | 8 -------- app/containers/SearchHeader.tsx | 10 +++------- app/index.tsx | 4 ++++ app/views/ChangePasscodeView.tsx | 9 +-------- app/views/NewServerView/index.tsx | 4 ---- app/views/RoomsListView/Header/Header.tsx | 12 ++++-------- app/views/RoomsListView/index.tsx | 2 -- app/views/ScreenLockedView.tsx | 9 +-------- app/views/SetUsernameView.tsx | 6 +----- app/views/Styles.ts | 4 ---- 16 files changed, 22 insertions(+), 89 deletions(-) diff --git a/__tests__/containers/RoomHeader/__snapshots__/RoomHeader.stories.storyshot b/__tests__/containers/RoomHeader/__snapshots__/RoomHeader.stories.storyshot index 1137808c7..abe53770c 100644 --- a/__tests__/containers/RoomHeader/__snapshots__/RoomHeader.stories.storyshot +++ b/__tests__/containers/RoomHeader/__snapshots__/RoomHeader.stories.storyshot @@ -2,8 +2,6 @@ exports[`Storyshots RoomHeader Icons 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"private channel\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"private channel\\"},\\"children\\":[\\"private channel\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"public channel\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"public channel\\"},\\"children\\":[\\"public channel\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"discussion\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"discussion\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"discussion\\"},\\"children\\":[\\"discussion\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"omnichannel\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#cbced1\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"omnichannel\\"},\\"children\\":[\\"omnichannel\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"private team\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"private team\\"},\\"children\\":[\\"private team\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"public team\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"public team\\"},\\"children\\":[\\"public team\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"group dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"group dm\\"},\\"children\\":[\\"group dm\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"online dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"online dm\\"},\\"children\\":[\\"online dm\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"away dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"away dm\\"},\\"children\\":[\\"away dm\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"busy dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"busy dm\\"},\\"children\\":[\\"busy dm\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"loading dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"loading dm\\"},\\"children\\":[\\"loading dm\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"offline dm\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"offline dm\\"},\\"children\\":[\\"offline dm\\"]}]}]}]}]"`; -exports[`Storyshots RoomHeader Landscape 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"title\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":12.8,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"title\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"subtitle\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"fontSize\\":9.600000000000001,\\"color\\":\\"#9ca2a8\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-subtitle\\"},\\"children\\":[\\"subtitle\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":12.8,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"fontSize\\":9.600000000000001,\\"color\\":\\"#9ca2a8\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}]}]"`; - exports[`Storyshots RoomHeader Themes 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"title\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"subtitle\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"fontSize\\":12,\\"color\\":\\"#9ca2a8\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-subtitle\\"},\\"children\\":[\\"subtitle\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#0b182c\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#f9f9f9\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#f9f9f9\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"title\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"subtitle\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#cbced1\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"fontSize\\":12,\\"color\\":\\"#9297a2\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-subtitle\\"},\\"children\\":[\\"subtitle\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#0d0d0d\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#f9f9f9\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#f9f9f9\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"title\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"subtitle\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#cbced1\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"fontSize\\":12,\\"color\\":\\"#b2b8c6\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-subtitle\\"},\\"children\\":[\\"subtitle\\"]}]}]}]"`; exports[`Storyshots RoomHeader Thread 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"title\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"title\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown-preview-title\\"},\\"children\\":[\\"title\\"]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#9ca2a8\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"parent title\\"]}]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"maxHeight\\":48,\\"backgroundColor\\":\\"#EEEFF1\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"markdown\\\\npreview\\\\n#3\\\\n4\\\\n5\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"room-header\\",\\"hitSlop\\":{\\"top\\":5,\\"right\\":5,\\"bottom\\":5,\\"left\\":5},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flex\\":1,\\"justifyContent\\":\\"center\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"markdown preview #3 4 5\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#2f343d\\"},{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"},{\\"fontSize\\":16,\\"color\\":\\"#0C0D0F\\"}],\\"numberOfLines\\":1,\\"testID\\":\\"markdown\\\\npreview\\\\n#3\\\\n4\\\\n5\\"},\\"children\\":[\\"markdown preview #3 4 5\\"]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"alignItems\\":\\"center\\",\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#0d0e12\\"},[{\\"marginRight\\":4},null],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"flexShrink\\":1,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#9ca2a8\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}]}]}]"`; diff --git a/app/containers/InAppNotification/IncomingCallNotification/index.tsx b/app/containers/InAppNotification/IncomingCallNotification/index.tsx index 0195da813..e93bd96f7 100644 --- a/app/containers/InAppNotification/IncomingCallNotification/index.tsx +++ b/app/containers/InAppNotification/IncomingCallNotification/index.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Text, View, useWindowDimensions } from 'react-native'; +import { Text, View } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useDispatch } from 'react-redux'; @@ -37,21 +37,16 @@ const IncomingCallHeader = React.memo( const [mic, setMic] = useState(true); const [cam, setCam] = useState(false); const dispatch = useDispatch(); - const isMasterDetail = useAppSelector(state => state.app.isMasterDetail); const styles = useStyle(); - const insets = useSafeAreaInsets(); - const { height, width } = useWindowDimensions(); - const isLandscape = width > height; - const { colors } = useTheme(); return ( { const { theme } = useTheme(); const insets = useSafeAreaInsets(); - const { isLandscape } = useOrientation(); - const { text, payload } = notification; const { type, rid } = payload; const name = type === 'd' ? payload.sender.username : payload.name; @@ -104,7 +101,7 @@ const NotifierComponent = React.memo(({ notification, isMasterDetail }: INotifie ( ); const Header = React.memo(({ handleReaction, message, isMasterDetail }: IHeader) => { - const { width, height } = useWindowDimensions(); + const { width } = useWindowDimensions(); const { theme } = useTheme(); const { frequentlyUsed, loaded } = useFrequentlyUsedEmoji(true); - const isLandscape = width > height; - const size = (isLandscape || isMasterDetail ? width / 2 : width) - CONTAINER_MARGIN * 2; + const size = (isMasterDetail ? width / 2 : width) - CONTAINER_MARGIN * 2; const quantity = Math.trunc(size / (ITEM_SIZE + ITEM_MARGIN * 2) - 1); const onReaction: TOnReaction = ({ emoji }) => { diff --git a/app/containers/Passcode/Base/index.tsx b/app/containers/Passcode/Base/index.tsx index cfe8ac741..cef3de3e3 100644 --- a/app/containers/Passcode/Base/index.tsx +++ b/app/containers/Passcode/Base/index.tsx @@ -1,10 +1,9 @@ -import React, { forwardRef, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react'; +import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'; import { Col, Grid, Row } from 'react-native-easy-grid'; import range from 'lodash/range'; import { View } from 'react-native'; import * as Animatable from 'react-native-animatable'; import * as Haptics from 'expo-haptics'; -import Orientation from 'react-native-orientation-locker'; import styles from './styles'; import Button from './Button'; @@ -16,7 +15,6 @@ import LockIcon from './LockIcon'; import Title from './Title'; import Subtitle from './Subtitle'; import { useDimensions } from '../../../dimensions'; -import { isTablet } from '../../../lib/methods/helpers'; interface IPasscodeBase { type: string; @@ -37,18 +35,6 @@ export interface IBase { const Base = forwardRef( ({ type, onEndProcess, previousPasscode, title, subtitle, onError, showBiometry, onBiometryPress }, ref) => { - useLayoutEffect(() => { - if (!isTablet) { - Orientation.lockToPortrait(); - } - - return () => { - if (!isTablet) { - Orientation.unlockAllOrientations(); - } - }; - }, []); - const { theme } = useTheme(); const { height } = useDimensions(); diff --git a/app/containers/ReactionsList/ReactionsTabBar.tsx b/app/containers/ReactionsList/ReactionsTabBar.tsx index de98b0e5a..01f00b34a 100644 --- a/app/containers/ReactionsList/ReactionsTabBar.tsx +++ b/app/containers/ReactionsList/ReactionsTabBar.tsx @@ -7,7 +7,7 @@ import { IReaction } from '../../definitions'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; import I18n from '../../i18n'; import styles, { MIN_TAB_WIDTH } from './styles'; -import { useDimensions, useOrientation } from '../../dimensions'; +import { useDimensions } from '../../dimensions'; interface ITabBarItem { getCustomEmoji: TGetCustomEmoji; @@ -55,10 +55,8 @@ const TabBarItem = ({ tab, index, goToPage, getCustomEmoji }: ITabBarItem) => { }; const ReactionsTabBar = ({ tabs, activeTab, goToPage, getCustomEmoji }: IReactionsTabBar): React.ReactElement => { - const { isLandscape } = useOrientation(); const { width } = useDimensions(); - const reactionsListWidth = isLandscape ? width / 2 : width; - const tabWidth = tabs && Math.max(reactionsListWidth / tabs.length, MIN_TAB_WIDTH); + const tabWidth = tabs && Math.max(width / tabs.length, MIN_TAB_WIDTH); const { colors } = useTheme(); return ( diff --git a/app/containers/RoomHeader/RoomHeader.stories.tsx b/app/containers/RoomHeader/RoomHeader.stories.tsx index 448906ae2..0e54650a1 100644 --- a/app/containers/RoomHeader/RoomHeader.stories.tsx +++ b/app/containers/RoomHeader/RoomHeader.stories.tsx @@ -66,14 +66,6 @@ export const Typing = () => ( ); -export const Landscape = () => ( - <> - } /> - } /> - } /> - -); - export const Thread = () => ( <> } /> diff --git a/app/containers/SearchHeader.tsx b/app/containers/SearchHeader.tsx index fff3390a5..e4a0672c4 100644 --- a/app/containers/SearchHeader.tsx +++ b/app/containers/SearchHeader.tsx @@ -6,8 +6,6 @@ import { useTheme } from '../theme'; import sharedStyles from '../views/Styles'; import { themes } from '../lib/constants'; import { TextInput } from './TextInput'; -import { isIOS, isTablet } from '../lib/methods/helpers'; -import { useOrientation } from '../dimensions'; const styles = StyleSheet.create({ container: { @@ -16,7 +14,8 @@ const styles = StyleSheet.create({ marginLeft: 0 }, title: { - ...sharedStyles.textSemibold + ...sharedStyles.textSemibold, + fontSize: 16 } }); @@ -28,15 +27,12 @@ interface ISearchHeaderProps { const SearchHeader = ({ onSearchChangeText, testID }: ISearchHeaderProps): JSX.Element => { const { theme } = useTheme(); const isLight = theme === 'light'; - const { isLandscape } = useOrientation(); - const scale = isIOS && isLandscape && !isTablet ? 0.8 : 1; - const titleFontSize = 16 * scale; return ( { }; if (isTablet) { this.initTablet(); + Orientation.unlockAllOrientations(); + } else { + Orientation.lockToPortrait(); } setNativeTheme(theme); } diff --git a/app/views/ChangePasscodeView.tsx b/app/views/ChangePasscodeView.tsx index 1dda46631..e6199ee9a 100644 --- a/app/views/ChangePasscodeView.tsx +++ b/app/views/ChangePasscodeView.tsx @@ -1,13 +1,12 @@ import React, { useEffect, useState } from 'react'; import { StyleSheet } from 'react-native'; -import Orientation from 'react-native-orientation-locker'; import useDeepCompareEffect from 'use-deep-compare-effect'; import isEmpty from 'lodash/isEmpty'; import Modal from 'react-native-modal'; import Touchable from 'react-native-platform-touchable'; import { useTheme } from '../theme'; -import { hasNotch, isTablet } from '../lib/methods/helpers'; +import { hasNotch } from '../lib/methods/helpers'; import { PasscodeChoose } from '../containers/Passcode'; import EventEmitter from '../lib/methods/helpers/events'; import { CustomIcon } from '../containers/CustomIcon'; @@ -65,14 +64,8 @@ const ChangePasscodeView = React.memo(() => { }; useEffect(() => { - if (!isTablet) { - Orientation.lockToPortrait(); - } const listener = EventEmitter.addEventListener(CHANGE_PASSCODE_EMITTER, showChangePasscode); return () => { - if (!isTablet) { - Orientation.unlockAllOrientations(); - } EventEmitter.removeListener(CHANGE_PASSCODE_EMITTER, listener); }; }, []); diff --git a/app/views/NewServerView/index.tsx b/app/views/NewServerView/index.tsx index 85d0846c3..742e2f798 100644 --- a/app/views/NewServerView/index.tsx +++ b/app/views/NewServerView/index.tsx @@ -3,7 +3,6 @@ import { Base64 } from 'js-base64'; import React from 'react'; import { BackHandler, Image, Keyboard, StyleSheet, Text, View } from 'react-native'; import { TouchableOpacity } from 'react-native-gesture-handler'; -import Orientation from 'react-native-orientation-locker'; import { connect } from 'react-redux'; import parse from 'url-parse'; @@ -88,9 +87,6 @@ interface ISubmitParams { class NewServerView extends React.Component { constructor(props: INewServerViewProps) { super(props); - if (!isTablet) { - Orientation.lockToPortrait(); - } this.setHeader(); this.state = { diff --git a/app/views/RoomsListView/Header/Header.tsx b/app/views/RoomsListView/Header/Header.tsx index e77686eb3..ea6daafe7 100644 --- a/app/views/RoomsListView/Header/Header.tsx +++ b/app/views/RoomsListView/Header/Header.tsx @@ -4,8 +4,6 @@ import { StyleSheet, Text, TextInputProps, TouchableOpacity, TouchableOpacityPro import I18n from '../../../i18n'; import sharedStyles from '../../Styles'; import { CustomIcon } from '../../../containers/CustomIcon'; -import { isIOS, isTablet } from '../../../lib/methods/helpers'; -import { useOrientation } from '../../../dimensions'; import { useTheme } from '../../../theme'; import SearchHeader from '../../../containers/SearchHeader'; @@ -20,9 +18,11 @@ const styles = StyleSheet.create({ }, title: { flexShrink: 1, + fontSize: 16, ...sharedStyles.textSemibold }, subtitle: { + fontSize: 14, ...sharedStyles.textRegular }, upsideDown: { @@ -55,10 +55,6 @@ const Header = React.memo( onPress }: IRoomHeader) => { const { colors } = useTheme(); - const { isLandscape } = useOrientation(); - const scale = isIOS && isLandscape && !isTablet ? 0.8 : 1; - const titleFontSize = 16 * scale; - const subTitleFontSize = 14 * scale; if (showSearchHeader) { return ; @@ -77,7 +73,7 @@ const Header = React.memo( - + {serverName} {subtitle} diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index cbf72b4d2..2084273ef 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { BackHandler, FlatList, Keyboard, NativeEventSubscription, RefreshControl, Text, View } from 'react-native'; import { batch, connect } from 'react-redux'; import { dequal } from 'dequal'; -import Orientation from 'react-native-orientation-locker'; import { Q } from '@nozbe/watermelondb'; import { withSafeAreaInsets } from 'react-native-safe-area-context'; import { Subscription } from 'rxjs'; @@ -217,7 +216,6 @@ class RoomsListView extends React.Component { - Orientation.unlockAllOrientations(); this.animated = true; // Check if there were changes with sort preference, then call getSubscription to remount the list if (this.sortPreferencesChanged) { diff --git a/app/views/ScreenLockedView.tsx b/app/views/ScreenLockedView.tsx index 1003c68b2..8cebb6f23 100644 --- a/app/views/ScreenLockedView.tsx +++ b/app/views/ScreenLockedView.tsx @@ -2,7 +2,6 @@ import isEmpty from 'lodash/isEmpty'; import React, { useEffect, useState } from 'react'; import { StyleSheet } from 'react-native'; import Modal from 'react-native-modal'; -import Orientation from 'react-native-orientation-locker'; import Touchable from 'react-native-platform-touchable'; import useDeepCompareEffect from 'use-deep-compare-effect'; @@ -10,7 +9,7 @@ import { PasscodeEnter } from '../containers/Passcode'; import { LOCAL_AUTHENTICATE_EMITTER } from '../lib/constants'; import { CustomIcon } from '../containers/CustomIcon'; import { useTheme } from '../theme'; -import { hasNotch, isTablet } from '../lib/methods/helpers'; +import { hasNotch } from '../lib/methods/helpers'; import EventEmitter from '../lib/methods/helpers/events'; interface IData { @@ -46,14 +45,8 @@ const ScreenLockedView = (): JSX.Element => { }; useEffect(() => { - if (!isTablet) { - Orientation.lockToPortrait(); - } const listener = EventEmitter.addEventListener(LOCAL_AUTHENTICATE_EMITTER, showScreenLock); return () => { - if (!isTablet) { - Orientation.unlockAllOrientations(); - } EventEmitter.removeListener(LOCAL_AUTHENTICATE_EMITTER, listener); }; }, []); diff --git a/app/views/SetUsernameView.tsx b/app/views/SetUsernameView.tsx index b500ecd18..207b7fcd2 100644 --- a/app/views/SetUsernameView.tsx +++ b/app/views/SetUsernameView.tsx @@ -2,7 +2,6 @@ import { useNavigation } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; import React, { useEffect, useLayoutEffect, useState } from 'react'; import { ScrollView, StyleSheet, Text } from 'react-native'; -import Orientation from 'react-native-orientation-locker'; import { useDispatch } from 'react-redux'; import { useForm } from 'react-hook-form'; import * as yup from 'yup'; @@ -18,7 +17,7 @@ import I18n from '../i18n'; import KeyboardView from '../containers/KeyboardView'; import { getUserSelector } from '../selectors/login'; import { useTheme } from '../theme'; -import { isTablet, showErrorAlert } from '../lib/methods/helpers'; +import { showErrorAlert } from '../lib/methods/helpers'; import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps'; import sharedStyles from './Styles'; import { Services } from '../lib/services'; @@ -56,9 +55,6 @@ const SetUsernameView = () => { useLayoutEffect(() => { navigation.setOptions({ title: server }); - if (!isTablet) { - Orientation.lockToPortrait(); - } }, [navigation, server]); useEffect(() => { diff --git a/app/views/Styles.ts b/app/views/Styles.ts index c341d13a0..dd7c9864b 100644 --- a/app/views/Styles.ts +++ b/app/views/Styles.ts @@ -122,9 +122,5 @@ export default StyleSheet.create({ }, inputLastChild: { marginBottom: 15 - }, - notchLandscapeContainer: { - marginTop: -34, - paddingHorizontal: 30 } });