-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: [게시글 생성] 상,하단 컴포넌트 #56
Changes from all commits
044fda4
db19244
9297545
c79320e
8c95cc0
db1b741
6475742
7bfd0cc
b8c8d47
e9166d8
761a91d
e48620b
a776fda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,9 @@ | |
}, | ||
"web": { | ||
"favicon": "./assets/favicon.png" | ||
}, | ||
"android": { | ||
"softwareKeyboardLayoutMode": "pan" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분은 정말 오랜 시간동안 찾아봤는데 마땅한 해결책이 없는 것 같아요.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 역시나 이미 했던 고민이군요! 저도 관련된 사항 알게 되면 공유하도록 할게요! ㅎ_ㅎ |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/** | ||
* @author lxxjn0 | ||
*/ | ||
import React from "react"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { useRecoilState } from "recoil/dist"; | ||
import { | ||
Modal, | ||
View, | ||
Text, | ||
TouchableHighlight, | ||
StyleSheet, | ||
} from "react-native"; | ||
import { articleModalActivationState } from "../states/articleState"; | ||
import { ArticleCreateModalNavigationProp } from "../types/types"; | ||
|
||
interface ArticleCreateScreenModalProps { | ||
resetCreateScreen: Function; | ||
} | ||
|
||
export default function ArticleCreateScreenModal({ | ||
resetCreateScreen, | ||
}: ArticleCreateScreenModalProps) { | ||
const navigation = useNavigation<ArticleCreateModalNavigationProp>(); | ||
const [articleModalState, setArticleModalState] = useRecoilState( | ||
articleModalActivationState, | ||
); | ||
|
||
return ( | ||
<Modal | ||
animationType={"fade"} | ||
transparent={true} | ||
visible={articleModalState} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. articleModalState가 boolean 같은데 is 처럼 boolean 값을 나타낼수 있는 네이밍을 변경해주면 어떤가 해서 의견 남겨요 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 처음엔 is를 접두어로 붙였는데 is 접두어의 경우 boolean을 반환하는 메서드 타입에서 주로 사용하는 것 같더라구요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그러네요 :) 메서드명으로 is를 붙여주네요 하나 알아갑니다 |
||
onRequestClose={() => setArticleModalState(false)} | ||
> | ||
<View style={styles.container}> | ||
<View style={styles.modalContainer}> | ||
<Text style={styles.modalText}> | ||
페이지를 나가면 작성 중인 내용이 삭제됩니다.{"\n"} | ||
페이지를 나가시겠습니까? | ||
</Text> | ||
<View style={styles.buttonContainer}> | ||
<TouchableHighlight | ||
style={styles.button} | ||
onPress={() => setArticleModalState(false)} | ||
> | ||
<Text style={styles.buttonText}>돌아가기</Text> | ||
</TouchableHighlight> | ||
<TouchableHighlight | ||
style={styles.button} | ||
onPress={() => { | ||
resetCreateScreen(); | ||
setArticleModalState(false); | ||
navigation.goBack(); | ||
}} | ||
> | ||
<Text style={styles.buttonText}>나가기</Text> | ||
</TouchableHighlight> | ||
</View> | ||
</View> | ||
</View> | ||
</Modal> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
}, | ||
modalContainer: { | ||
backgroundColor: "white", | ||
borderRadius: 20, | ||
padding: 25, | ||
alignItems: "center", | ||
shadowColor: "black", | ||
shadowOffset: { | ||
width: 3, | ||
height: 5, | ||
}, | ||
shadowOpacity: 0.25, | ||
shadowRadius: 5, | ||
elevation: 3, | ||
}, | ||
modalText: { | ||
marginBottom: 20, | ||
textAlign: "center", | ||
}, | ||
buttonContainer: { | ||
flexDirection: "row", | ||
}, | ||
button: { | ||
backgroundColor: "#dfd3c3", | ||
borderRadius: 20, | ||
marginHorizontal: 5, | ||
padding: 10, | ||
elevation: 2, | ||
}, | ||
buttonText: { | ||
color: "white", | ||
fontWeight: "bold", | ||
textAlign: "center", | ||
marginHorizontal: 10, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모듈추가하면서 생긴건가요? 어떤 설정인가요?😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안드로이드에서 입력 창을 누르면 키보드가 올라오면서 해결하기 위한 설정입니다 :)