diff options
author | Eric Bailey <git@esb.lol> | 2024-05-17 17:03:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 15:03:50 -0700 |
commit | 1cdcb3e6c333b7ad5aa53676163643d7f43d1528 (patch) | |
tree | bd512fbaf93009bd00d60b34a7b97bb4e1469177 /src/components/Dialog | |
parent | d02e0884c40adebe3799254395d933205b104a86 (diff) | |
download | voidsky-1cdcb3e6c333b7ad5aa53676163643d7f43d1528.tar.zst |
[🐴] New chat dialog refresh (#4071)
* Checkpoint, header styled, empty * Checkpoint, styles * Show recent follows in initial state, finesse some styles * Add skeleton * Add some limits * Fix autofocus on web, use bottom sheet input on native * Ignore type * Clean up edits * Format * Tweak icon placement * Fix type * use prop for dismissing keyboard --------- Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/components/Dialog')
-rw-r--r-- | src/components/Dialog/index.tsx | 7 | ||||
-rw-r--r-- | src/components/Dialog/index.web.tsx | 21 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index b5258c02b..b88159613 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -1,5 +1,5 @@ import React, {useImperativeHandle} from 'react' -import {Dimensions, Pressable, View} from 'react-native' +import {Dimensions, Pressable, StyleProp, View, ViewStyle} from 'react-native' import Animated, {useAnimatedStyle} from 'react-native-reanimated' import {useSafeAreaInsets} from 'react-native-safe-area-context' import BottomSheet, { @@ -257,9 +257,10 @@ export const ScrollableInner = React.forwardRef< export const InnerFlatList = React.forwardRef< BottomSheetFlatListMethods, - BottomSheetFlatListProps<any> + BottomSheetFlatListProps<any> & {webInnerStyle?: StyleProp<ViewStyle>} >(function InnerFlatList({style, contentContainerStyle, ...props}, ref) { const insets = useSafeAreaInsets() + return ( <BottomSheetFlatList keyboardShouldPersistTaps="handled" @@ -276,6 +277,8 @@ export const InnerFlatList = React.forwardRef< a.h_full, { marginTop: 40, + borderTopLeftRadius: 40, + borderTopRightRadius: 40, }, flatten(style), ]} diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 4cb4e7570..35d807b4b 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -2,8 +2,10 @@ import React, {useImperativeHandle} from 'react' import { FlatList, FlatListProps, + StyleProp, TouchableWithoutFeedback, View, + ViewStyle, } from 'react-native' import Animated, {FadeIn, FadeInDown} from 'react-native-reanimated' import {msg} from '@lingui/macro' @@ -199,18 +201,21 @@ export const ScrollableInner = Inner export const InnerFlatList = React.forwardRef< FlatList, - FlatListProps<any> & {label: string} ->(function InnerFlatList({label, style, ...props}, ref) { + FlatListProps<any> & {label: string} & {webInnerStyle?: StyleProp<ViewStyle>} +>(function InnerFlatList({label, style, webInnerStyle, ...props}, ref) { const {gtMobile} = useBreakpoints() return ( <Inner label={label} - // @ts-ignore web only -sfn - style={{ - paddingHorizontal: 0, - maxHeight: 'calc(-36px + 100vh)', - overflow: 'hidden', - }}> + style={[ + // @ts-ignore web only -sfn + { + paddingHorizontal: 0, + maxHeight: 'calc(-36px + 100vh)', + overflow: 'hidden', + }, + webInnerStyle, + ]}> <FlatList ref={ref} style={[gtMobile ? a.px_2xl : a.px_xl, flatten(style)]} |