mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Avoid no-use-before-define lint suppressions by rearranging declarations. (#3225)
By moving `styles` higher up in the file, we can remove the suppressions.
This commit is contained in:
@@ -13,9 +13,32 @@ interface ButtonProps {
|
||||
style?: object;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create( {
|
||||
button: {
|
||||
fontSize: 16,
|
||||
margin: 16
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: "white"
|
||||
},
|
||||
text: {
|
||||
fontSize: 20,
|
||||
textAlign: "center",
|
||||
margin: 16
|
||||
},
|
||||
buttonGroup: {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-around",
|
||||
alignItems: "center"
|
||||
},
|
||||
destructive: {
|
||||
color: "red"
|
||||
}
|
||||
} );
|
||||
|
||||
const Button = ( { onPress, title, style }: ButtonProps ) => (
|
||||
<Pressable accessibilityRole="button" onPress={onPress}>
|
||||
{/* eslint-disable-next-line no-use-before-define */}
|
||||
<Text style={[styles.button, style]}>{title}</Text>
|
||||
</Pressable>
|
||||
);
|
||||
@@ -32,7 +55,6 @@ const ShareSheet = () => {
|
||||
|
||||
const {
|
||||
container, text, buttonGroup, destructive
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
} = styles;
|
||||
|
||||
return (
|
||||
@@ -59,28 +81,4 @@ const ShareSheet = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create( {
|
||||
button: {
|
||||
fontSize: 16,
|
||||
margin: 16
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: "white"
|
||||
},
|
||||
text: {
|
||||
fontSize: 20,
|
||||
textAlign: "center",
|
||||
margin: 16
|
||||
},
|
||||
buttonGroup: {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-around",
|
||||
alignItems: "center"
|
||||
},
|
||||
destructive: {
|
||||
color: "red"
|
||||
}
|
||||
} );
|
||||
|
||||
export default ShareSheet;
|
||||
|
||||
Reference in New Issue
Block a user