diff --git a/public/index.html b/public/index.html
index f3791c8362..c01f68c303 100644
--- a/public/index.html
+++ b/public/index.html
@@ -10,7 +10,7 @@
/* These styles disable body scrolling if you are using */
body { overflow: hidden; }
/* These styles make the root element full-height */
- #root { display:flex; height:100%; }
+ #app-root { display:flex; height:100%; }
/* These styles are for src/view/com/modals/WebModal */
div[data-modal-overlay] {
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx
index a52bc643cc..59dbf1e169 100644
--- a/src/view/com/post-thread/PostThread.tsx
+++ b/src/view/com/post-thread/PostThread.tsx
@@ -1,6 +1,7 @@
import React, {useRef} from 'react'
import {observer} from 'mobx-react-lite'
-import {ActivityIndicator, FlatList, View} from 'react-native'
+import {ActivityIndicator, View} from 'react-native'
+import {CenteredView, FlatList} from '../util/Views'
import {
PostThreadViewModel,
PostThreadViewPostModel,
@@ -50,9 +51,9 @@ export const PostThread = observer(function PostThread({
// =
if ((view.isLoading && !view.isRefreshing) || view.params.uri !== uri) {
return (
-
+
-
+
)
}
@@ -60,9 +61,9 @@ export const PostThread = observer(function PostThread({
// =
if (view.hasError) {
return (
-
+
-
+
)
}
diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx
index db68776600..db05caa3c9 100644
--- a/src/view/com/posts/Feed.tsx
+++ b/src/view/com/posts/Feed.tsx
@@ -3,11 +3,11 @@ import {observer} from 'mobx-react-lite'
import {
ActivityIndicator,
View,
- FlatList,
StyleProp,
StyleSheet,
ViewStyle,
} from 'react-native'
+import {CenteredView, FlatList} from '../util/Views'
import {PostFeedLoadingPlaceholder} from '../util/LoadingPlaceholder'
import {EmptyState} from '../util/EmptyState'
import {ErrorMessage} from '../util/error/ErrorMessage'
@@ -86,11 +86,16 @@ export const Feed = observer(function Feed({
)
return (
- {!data && }
- {feed.isLoading && !data && }
- {feed.hasError && (
-
- )}
+
+ {!data && }
+ {feed.isLoading && !data && }
+ {feed.hasError && (
+
+ )}
+
{feed.hasLoaded && data && (
for views that
+ * need to match layout but which aren't scrolled.
+ */
+
+import React from 'react'
+import {
+ FlatList as RNFlatList,
+ FlatListProps,
+ ScrollView as RNScrollView,
+ ScrollViewProps,
+ StyleSheet,
+ StyleProp,
+ View,
+ ViewProps,
+} from 'react-native'
+
+export function CenteredView({
+ style,
+ ...props
+}: React.PropsWithChildren) {
+ style = addStyle(style, styles.container)
+ return
+}
+
+export function FlatList({
+ contentContainerStyle,
+ ...props
+}: React.PropsWithChildren>) {
+ contentContainerStyle = addStyle(contentContainerStyle, styles.container)
+ return
+}
+
+export function ScrollView({
+ contentContainerStyle,
+ ...props
+}: React.PropsWithChildren) {
+ contentContainerStyle = addStyle(contentContainerStyle, styles.container)
+ return (
+
+ )
+}
+
+function addStyle(
+ base: StyleProp,
+ addedStyle: StyleProp,
+): StyleProp {
+ if (Array.isArray(base)) {
+ return base.concat([addedStyle])
+ }
+ return [base, addedStyle]
+}
+
+const styles = StyleSheet.create({
+ container: {
+ width: '100%',
+ maxWidth: 600,
+ marginLeft: 'auto',
+ marginRight: 'auto',
+ },
+})
diff --git a/src/view/shell/web/index.tsx b/src/view/shell/web/index.tsx
index 9032eb8840..c7bfeff19f 100644
--- a/src/view/shell/web/index.tsx
+++ b/src/view/shell/web/index.tsx
@@ -18,26 +18,22 @@ export const WebShell: React.FC = observer(() => {
if (!store.session.hasSession) {
return (
-
-
-
+
)
}
return (
-
- {screenRenderDesc.screens.map(({Com, navIdx, params, key, current}) => (
-
-
-
-
-
- ))}
-
+ {screenRenderDesc.screens.map(({Com, navIdx, params, key, current}) => (
+
+
+
+
+
+ ))}
)
// TODO