7.3.3 WriteHeader 수정하기
WriteHeader에서 isEditing Props가 true일 때만 삭제 버튼을 보여주고, 이 버튼을 눌렀을 때 onAskRemove를 호출하도록 컴포넌트를 수정해줍시다.
components/WriteHeader.js
(function ({onSave, onAskRemove, isEditing}) { const navigation (); const () => { navigation. (); }; return ( <View style={styles.block}> <View style={styles.iconButtonWrapper}> <TransparentCircleButton onPress={onGoBack} name="arrow-back" color="#424242" /> </View> <View style={styles.buttons}> {isEditing && ( <TransparentCircleButton name="delete-forever" color="#ef5350" hasMarginRight onPress={onAskRemove} /> )} <TransparentCircleButton name="check" color="#009688" onPress={onSave} /> </View> </View> ); } ( ))