diff --git a/src/App.native.tsx b/src/App.native.tsx index f00e3cad1c..39988c5aed 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -61,17 +61,17 @@ const App = observer(() => { return ( - - - - + + + + - - - - + + + + ) }) diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index b886d83e4d..83259330f2 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -86,12 +86,18 @@ function ImageViewing({ [toggleBarsVisible], ) + const onLayout = useCallback(() => { + if (imageIndex) { + imageList.current?.scrollToIndex({index: imageIndex, animated: false}) + } + }, [imageList, imageIndex]) + if (!visible) { return null } return ( - + @@ -110,7 +116,6 @@ function ImageViewing({ pagingEnabled showsHorizontalScrollIndicator={false} showsVerticalScrollIndicator={false} - initialScrollIndex={imageIndex} getItem={(_, index) => images[index]} getItemCount={() => images.length} getItemLayout={(_, index) => ({ diff --git a/src/view/com/util/forms/DropdownButton.tsx b/src/view/com/util/forms/DropdownButton.tsx index 63aecc4798..6165c191d1 100644 --- a/src/view/com/util/forms/DropdownButton.tsx +++ b/src/view/com/util/forms/DropdownButton.tsx @@ -18,6 +18,8 @@ import {toShareUrl} from '../../../../lib/strings' import {useStores} from '../../../../state' import {ReportPostModal, ConfirmModal} from '../../../../state/models/shell-ui' import {TABS_ENABLED} from '../../../../build-flags' +import {usePalette} from '../../../lib/hooks/usePalette' +import {useTheme} from '../../../lib/ThemeContext' const HITSLOP = {left: 10, top: 10, right: 10, bottom: 10} @@ -181,24 +183,14 @@ function createDropdownMenu( const onOuterPress = () => sibling.destroy() const sibling = new RootSiblings( ( - <> - - - - - {items.map((item, index) => ( - onPressItem(index)}> - {item.icon && ( - - )} - {item.label} - - ))} - - + ), ) return sibling @@ -242,3 +234,55 @@ const styles = StyleSheet.create({ fontSize: 18, }, }) +type DropDownItemProps = { + onOuterPress: () => void + x: number + y: number + width: number + items: DropdownItem[] + onPressItem: (index: number) => void +} + +const DropdownItems = ({ + onOuterPress, + x, + y, + width, + items, + onPressItem, +}: DropDownItemProps): React.ReactNode => { + const pal = usePalette('default') + const theme = useTheme() + const dropDownBackgroundColor = + theme.colorScheme === 'dark' ? pal.btn : pal.view + + return ( + <> + + + + + {items.map((item, index) => ( + onPressItem(index)}> + {item.icon && ( + + )} + {item.label} + + ))} + + + ) +}