Skip to content

Commit

Permalink
Primary button prettier code issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JazzV2 committed Jan 3, 2024
1 parent c8ff96a commit c86cfd8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
1 change: 0 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PrimaryButton from '@/components/PrimaryButton';
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

Expand Down
50 changes: 25 additions & 25 deletions src/components/PrimaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { Pressable, StyleSheet, Text, View } from 'react-native'
import React from 'react'
import { Pressable, StyleSheet, Text } from 'react-native';

Check warning on line 1 in src/components/PrimaryButton.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/components/PrimaryButton.tsx#L1

Run autofix to sort these imports! (simple-import-sort/imports)
import React from 'react';

Check warning on line 2 in src/components/PrimaryButton.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/components/PrimaryButton.tsx#L2

`react` import should occur before import of `react-native` (import/order)

interface Param {
title: string;
onPress: any;
title: string;
onPress: any;
}

const PrimaryButton = (param: Param) => {
return (
<Pressable style = {styles.button} onPress={param.onPress}>
<Text style = {styles.text}>{param.title}</Text>
<Pressable style={styles.button} onPress={param.onPress}>
<Text style={styles.text}>{param.title}</Text>
</Pressable>
)
}
);
};

export default PrimaryButton
export default PrimaryButton;

const styles = StyleSheet.create({
button: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#5964AB',
width: 291,
height: 44,
borderRadius: 10
},
button: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#5964AB',
width: 291,
height: 44,
borderRadius: 10,
},

text: {
color: '#FFFFFF',
fontSize: 12,
lineHeight: 15,
fontWeight: '500',
textAlign: 'center'
}
})
text: {
color: '#FFFFFF',
fontSize: 12,
lineHeight: 15,
fontWeight: '500',
textAlign: 'center',
},
});

0 comments on commit c86cfd8

Please sign in to comment.