Skip to content

Commit

Permalink
[PAY-1318] Missing Shadow and Space Between Divider and Header (#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
piazzatron authored Jun 2, 2023
1 parent e71845e commit d012240
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/mobile/src/screens/chat-screen/ChatListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useThemePalette, useColor } from 'app/utils/theme'

import { ChatListItem } from './ChatListItem'
import { ChatListItemSkeleton } from './ChatListItemSkeleton'
import { HeaderShadow } from './HeaderShadow'

const { getChats, getChatsStatus } = chatSelectors
const { fetchMoreMessages, fetchMoreChats } = chatActions
Expand Down Expand Up @@ -74,11 +75,6 @@ const useStyles = makeStyles(({ spacing, palette, typography }) => ({
},
writeMessageButton: {
marginTop: spacing(6)
},
shadow: {
borderBottomColor: palette.neutralLight6,
borderBottomWidth: 3,
borderBottomLeftRadius: 1
}
}))

Expand Down Expand Up @@ -150,7 +146,7 @@ export const ChatListScreen = () => {
topbarRight={iconCompose}
>
<ScreenContent>
<View style={styles.shadow} />
<HeaderShadow />
<View style={styles.rootContainer}>
{isLoadingFirstTime ? (
Array(4)
Expand Down
2 changes: 2 additions & 0 deletions packages/mobile/src/screens/chat-screen/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { ChatMessageSeparator } from './ChatMessageSeparator'
import { ChatTextInput } from './ChatTextInput'
import { ChatUnavailable } from './ChatUnavailable'
import { EmptyChatMessages } from './EmptyChatMessages'
import { HeaderShadow } from './HeaderShadow'
import { ReactionPopup } from './ReactionPopup'
import { END_REACHED_OFFSET } from './constants'

Expand Down Expand Up @@ -506,6 +507,7 @@ export const ChatScreen = () => {
topbarRight={topBarRight}
>
<ScreenContent>
<HeaderShadow />
{/* Everything inside the portal displays on top of all other screen contents. */}
<Portal hostName='ChatReactionsPortal'>
{canSendMessage && shouldShowPopup && popupMessage ? (
Expand Down
26 changes: 26 additions & 0 deletions packages/mobile/src/screens/chat-screen/HeaderShadow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { View } from 'react-native'

import { makeStyles } from 'app/styles'
import { zIndex } from 'app/utils/zIndex'

const useStyles = makeStyles(({ palette }) => ({
shadow: {
height: 1,
borderBottomWidth: 0,
backgroundColor: palette.neutralLight8,
shadowColor: 'black',
shadowOpacity: 0.3,
shadowRadius: 3,
zIndex: zIndex.HEADER_SHADOW,
shadowOffset: { width: 0, height: 2 }
}
}))

/**
* Hack: temporary component to add a shadow below mobile headers for DMs.
* TODO: delete this and implement app wide header shadows [C-2709]
*/
export const HeaderShadow = () => {
const styles = useStyles()
return <View style={styles.shadow} />
}
3 changes: 2 additions & 1 deletion packages/mobile/src/utils/zIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export enum zIndex {
PREMIUM_TRACK_TILE_CORNER_TAG = 3,
CHAT_REACTIONS_POPUP_DIM_BACKGROUND = 10,
CHAT_REACTIONS_POPUP_CLOSE_PRESSABLES = 20,
CHAT_REACTIONS_POPUP_CONTENT = 30
CHAT_REACTIONS_POPUP_CONTENT = 30,
HEADER_SHADOW = 10
}

0 comments on commit d012240

Please sign in to comment.