···99export * from './theme';
1010export * from './stores';
1111export * from './settings';
1212+export { default as styles } from './styles';
-27
src/layouts/Centered.tsx
···11-// Copyright (c) 2026 Joseph Hale
22-//
33-// This Source Code Form is subject to the terms of the Mozilla Public
44-// License, v. 2.0. If a copy of the MPL was not distributed with this
55-// file, You can obtain one at https://mozilla.org/MPL/2.0/.
66-import React from "react"
77-import { StyleSheet, View } from "react-native";
88-99-/**
1010- * A `View` that centers its children vertically and horizontally.
1111- */
1212-export default function Centered(props: React.ComponentProps<typeof View>) {
1313- return (
1414- <View {...props} style={[props.style, styles.container]}>
1515- {props.children}
1616- </View>
1717- )
1818-}
1919-2020-const styles = StyleSheet.create({
2121- container: {
2222- width: '100%',
2323- height: '100%',
2424- justifyContent: 'center',
2525- alignItems: 'center',
2626- }
2727-});
-28
src/layouts/Filled.tsx
···11-// Copyright (c) 2026 Joseph Hale
22-//
33-// This Source Code Form is subject to the terms of the Mozilla Public
44-// License, v. 2.0. If a copy of the MPL was not distributed with this
55-// file, You can obtain one at https://mozilla.org/MPL/2.0/.
66-77-import React from "react"
88-import { StyleSheet, View } from "react-native";
99-1010-/**
1111- * A `View` that fills all available space.
1212- *
1313- * i.e. forces `{ width: '100%', height: '100%' }`
1414- */
1515-export default function Filled(props: React.ComponentProps<typeof View>) {
1616- return (
1717- <View {...props} style={[props.style, styles.container]}>
1818- {props.children}
1919- </View>
2020- )
2121-}
2222-2323-const styles = StyleSheet.create({
2424- container: {
2525- width: '100%',
2626- height: '100%',
2727- }
2828-});
+3-3
src/layouts/Measured.tsx
···6677import React, { createContext, useContext, useState } from "react";
88import { View } from "react-native";
99-import Filled from "./Filled";
99+import styles from "./styles";
10101111/**
1212 * Children of this component can `useMeasurements` to get the
···3939 };
40404141 return (
4242- <Filled onLayout={measure}>
4242+ <View style={styles.filled} onLayout={measure}>
4343 {measurements.width > 0 && measurements.height > 0 && (
4444 <MeasurementsContext value={measurements}>
4545 {children}
4646 </MeasurementsContext>
4747 )}
4848- </Filled>
4848+ </View>
4949 );
5050}
5151
-2
src/layouts/index.ts
···44// License, v. 2.0. If a copy of the MPL was not distributed with this
55// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6677-export { default as Centered } from './Centered';
88-export { default as Filled } from './Filled';
97export { default as Measured, useMeasurements } from "./Measured";
+20
src/layouts/styles.ts
···11+// Copyright (c) 2026 Joseph Hale
22+//
33+// This Source Code Form is subject to the terms of the Mozilla Public
44+// License, v. 2.0. If a copy of the MPL was not distributed with this
55+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
66+77+import { StyleSheet } from "react-native";
88+99+const styles = StyleSheet.create({
1010+ centered: {
1111+ justifyContent: 'center',
1212+ alignItems: 'center',
1313+ },
1414+ filled: {
1515+ width: '100%',
1616+ height: '100%',
1717+ }
1818+})
1919+2020+export default styles;
+11
src/styles.ts
···11+// Copyright (c) 2026 Joseph Hale
22+//
33+// This Source Code Form is subject to the terms of the Mozilla Public
44+// License, v. 2.0. If a copy of the MPL was not distributed with this
55+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
66+77+import layout from "./layouts/styles";
88+99+const styles = { layout };
1010+1111+export default styles;