···1010 /* These styles disable body scrolling if you are using <ScrollView> */
1111 body { overflow: hidden; }
1212 /* These styles make the root element full-height */
1313- #root { display:flex; height:100%; }
1313+ #app-root { display:flex; height:100%; }
14141515 /* These styles are for src/view/com/modals/WebModal */
1616 div[data-modal-overlay] {
···11+export {View as CenteredView, FlatList, ScrollView} from 'react-native'
+70
src/view/com/util/Views.web.tsx
···11+/**
22+ * In the Web build, we center all content so that it mirrors the
33+ * mobile experience (a single narrow column). We then place a UI
44+ * shell around the content if you're in desktop.
55+ *
66+ * Because scrolling is handled by components deep in the hierarchy,
77+ * we can't just wrap the top-level element with a max width. The
88+ * centering has to be done at the ScrollView.
99+ *
1010+ * These components wrap the RN ScrollView-based components to provide
1111+ * consistent layout. It also provides <CenteredView> for views that
1212+ * need to match layout but which aren't scrolled.
1313+ */
1414+1515+import React from 'react'
1616+import {
1717+ FlatList as RNFlatList,
1818+ FlatListProps,
1919+ ScrollView as RNScrollView,
2020+ ScrollViewProps,
2121+ StyleSheet,
2222+ StyleProp,
2323+ View,
2424+ ViewProps,
2525+} from 'react-native'
2626+2727+export function CenteredView({
2828+ style,
2929+ ...props
3030+}: React.PropsWithChildren<ViewProps>) {
3131+ style = addStyle(style, styles.container)
3232+ return <View style={style} {...props} />
3333+}
3434+3535+export function FlatList<ItemT>({
3636+ contentContainerStyle,
3737+ ...props
3838+}: React.PropsWithChildren<FlatListProps<ItemT>>) {
3939+ contentContainerStyle = addStyle(contentContainerStyle, styles.container)
4040+ return <RNFlatList contentContainerStyle={contentContainerStyle} {...props} />
4141+}
4242+4343+export function ScrollView({
4444+ contentContainerStyle,
4545+ ...props
4646+}: React.PropsWithChildren<ScrollViewProps>) {
4747+ contentContainerStyle = addStyle(contentContainerStyle, styles.container)
4848+ return (
4949+ <RNScrollView contentContainerStyle={contentContainerStyle} {...props} />
5050+ )
5151+}
5252+5353+function addStyle<T>(
5454+ base: StyleProp<T>,
5555+ addedStyle: StyleProp<T>,
5656+): StyleProp<T> {
5757+ if (Array.isArray(base)) {
5858+ return base.concat([addedStyle])
5959+ }
6060+ return [base, addedStyle]
6161+}
6262+6363+const styles = StyleSheet.create({
6464+ container: {
6565+ width: '100%',
6666+ maxWidth: 600,
6767+ marginLeft: 'auto',
6868+ marginRight: 'auto',
6969+ },
7070+})