Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FE/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';

import { StyleSheet, Text, View } from 'react-native';
import ButtonPiece from './ButtonPiece.js';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
<Button title="test" />
<ButtonPiece buttonTitle="aa" isEnabled={false} />
</View>
);
}
Expand Down
14 changes: 14 additions & 0 deletions FE/ButtonPiece.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Button } from 'react-native';
export default function App({ buttonTitle, isEnabled }) {
if(isEnabled) {
return (
<Button title={buttonTitle} />
);
}
else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else를 꼭 써야할까요? emotion을 사용해서 props에 따라 스타일링을 하는 방식은 어떨까요?

return (
<Button title="??" />
)
}
}