Skip to content

Commit

Permalink
[#11] Feat: Allow choosing whether to save
Browse files Browse the repository at this point in the history
  • Loading branch information
hee-suh committed Feb 27, 2022
1 parent cc2e6e0 commit bb96125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions react-native/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface BottomDrawerProps {
showFullText?: boolean,
showTranslated?: boolean,
isFullDrawer?: boolean,
save?: boolean,
handleFullText?: () => void,
saveResults?: () => void,
handleTranslatedText?: () => void,
Expand Down Expand Up @@ -39,9 +40,11 @@ function BottomDrawer(props: BottomDrawerProps) {
<TouchableOpacity style={styles.rightSpace} onPress={props.handleFullText}>
<Entypo name="text" size={32} color="#000"/>
</TouchableOpacity>
<TouchableOpacity onPress={props.saveResults}>
<FontAwesome name="save" size={32} color='#000' />
</TouchableOpacity>
{props.save &&
<TouchableOpacity onPress={props.saveResults}>
<FontAwesome name="save" size={32} color='#000' />
</TouchableOpacity>
}
</View>
) : (
<TouchableOpacity style={styles.rightSpace} onPress={props.handleTranslatedText}>
Expand Down
2 changes: 2 additions & 0 deletions react-native/screens/TranslateScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export default function TranslateScreen({ navigation }: Navigation) {
showFullText={showFullText}
showTranslated={showTranslated}
isFullDrawer={isFullDrawer}
save={true}
handleFullText={handleFullText}
saveResults={saveResults}
handleTranslatedText={handleTranslatedText}
Expand All @@ -130,6 +131,7 @@ export default function TranslateScreen({ navigation }: Navigation) {
showFullText={showFullText}
showTranslated={showTranslated}
isFullDrawer={isFullDrawer}
save={true}
handleFullText={handleFullText}
saveResults={saveResults}
handleTranslatedText={handleTranslatedText}
Expand Down

0 comments on commit bb96125

Please sign in to comment.