-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e28d27
commit 789ae90
Showing
9 changed files
with
116 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Share } from 'react-native'; | ||
import Icon from '../../../assets/icons'; | ||
import { View } from "react-native"; | ||
import ReactionPicker from "../ReactionPicker/ReactionPicker"; | ||
import SaveStoryButton from "../SaveStoryButton/SaveStoryButton"; | ||
import FavoriteStoryButton from "../FavoriteStoryButton/FavoriteStoryButton"; | ||
import { TouchableOpacity } from "react-native-gesture-handler"; | ||
import styles from "./styles"; | ||
import { Story } from '../../queries/types'; | ||
|
||
type OptionBarProps = { | ||
storyId: number | ||
story: Story | ||
} | ||
|
||
function OptionBar({ storyId, story }: OptionBarProps) { | ||
const onShare = async () => { | ||
try { | ||
const result = await Share.share({ | ||
message: `Check out this story from Girls Write Now! \n${story.link}/`, | ||
}); | ||
if (result.action === Share.sharedAction) { | ||
if (result.activityType) { | ||
// shared with activity type of result.activityType | ||
} else { | ||
// shared | ||
} | ||
} else if (result.action === Share.dismissedAction) { | ||
// dismissed | ||
} | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
|
||
return ( | ||
<View style={styles.options}> | ||
<ReactionPicker storyId={storyId} /> | ||
|
||
<View style={styles.right}> | ||
<SaveStoryButton storyId={storyId} /> | ||
<FavoriteStoryButton storyId={storyId} /> | ||
<TouchableOpacity onPress={onShare}> | ||
<Icon type="share_outline" /> | ||
</TouchableOpacity> | ||
</View> | ||
</View> | ||
|
||
) | ||
} | ||
|
||
export default OptionBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
import { StyleSheet } from 'react-native'; | ||
|
||
const styles = StyleSheet.create({ | ||
options: { | ||
backgroundColor: 'white', | ||
paddingTop: 16, | ||
flex: 1, | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
paddingBottom: 22, | ||
}, | ||
right: { | ||
alignSelf: 'flex-end', | ||
gap: 8, | ||
flexDirection: 'row', | ||
} | ||
}); | ||
|
||
export default styles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters