-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding new post types * fixing lint * all navigation to person added * linter pass * once more
- Loading branch information
Showing
8 changed files
with
553 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,78 @@ | ||
import React from "react"; | ||
import { StyleSheet, Text, View } from "react-native"; | ||
import { useNavigation } from '@react-navigation/native'; | ||
import React from 'react'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
// import FeedPage from '../../pages/FeedPage'; | ||
// import Follow from '../../pages/Follow'; | ||
import { AuthNavigationProp } from '../../types/navigationTypes'; | ||
|
||
type FeedBarProps = { | ||
tab: string, | ||
setTab: React.Dispatch<React.SetStateAction<string>>, | ||
} | ||
type FeedBarProps = { | ||
tab: string; | ||
setTab: React.Dispatch<React.SetStateAction<string>>; | ||
}; | ||
|
||
const FeedTopBar: React.FC<FeedBarProps> = ({tab, setTab}) => { | ||
return ( | ||
<View style={styles.top_bar}> | ||
<Text | ||
style={tab == 'Explore' ? styles.explore : styles.follow} | ||
onPress={() => setTab('Explore')}> | ||
Explore | ||
</Text> | ||
<Text | ||
style={tab == 'Following' ? styles.explore : styles.follow} | ||
onPress={() => setTab('Following')}> | ||
Following | ||
</Text> | ||
</View> | ||
) | ||
} | ||
const FeedTopBar: React.FC<FeedBarProps> = ({ tab, setTab }) => { | ||
const navigation = useNavigation<AuthNavigationProp>(); | ||
|
||
const handleButtonPress = () => { | ||
setTab('Explore') | ||
navigation.navigate('Feed'); | ||
}; | ||
|
||
const handleButtonPress2 = () => { | ||
setTab('Explore') | ||
navigation.navigate('Follow'); | ||
}; | ||
|
||
return ( | ||
<View style={styles.top_bar}> | ||
<Text | ||
style={tab == 'Explore' ? styles.explore : styles.follow} | ||
onPress={handleButtonPress}> | ||
Explore | ||
</Text> | ||
<Text | ||
style={tab == 'Following' ? styles.explore : styles.follow} | ||
onPress={handleButtonPress2}> | ||
Following | ||
</Text> | ||
</View> | ||
); | ||
}; | ||
|
||
export default FeedTopBar; | ||
|
||
const styles = StyleSheet.create({ | ||
top_bar: { | ||
width: "100%", | ||
flex: 1, | ||
marginTop: "15%", | ||
backgroundColor: '#FFFFFF', | ||
flexDirection: "row", | ||
// backgroundRepeat: 'no-repeat', | ||
// backgroundPosition: 'center center', | ||
// backgroundSize: 'cover', | ||
padding: 20, | ||
overflow: 'hidden', | ||
zIndex: 2, | ||
}, | ||
explore: { | ||
width: "50%", | ||
color: 'rgba(0,0,0,1)', | ||
fontFamily: 'Circular Std', | ||
fontWeight: '500', | ||
fontSize: 17, | ||
opacity: 1, | ||
textAlign: 'center', | ||
borderBottomColor: 'rgba(0,0,0,1)', | ||
borderBottomWidth: 1, | ||
}, | ||
follow: { | ||
width: "50%", | ||
color: 'rgba(102,102,102,1)', | ||
fontFamily: 'Circular Std', | ||
fontWeight: '500', | ||
fontSize: 17, | ||
opacity: 1, | ||
textAlign: 'center', | ||
}, | ||
}) | ||
top_bar: { | ||
width: '100%', | ||
flex: 1, | ||
marginTop: '15%', | ||
backgroundColor: '#FFFFFF', | ||
flexDirection: 'row', | ||
// backgroundRepeat: 'no-repeat', | ||
// backgroundPosition: 'center center', | ||
// backgroundSize: 'cover', | ||
padding: 20, | ||
overflow: 'hidden', | ||
zIndex: 2, | ||
}, | ||
explore: { | ||
width: '50%', | ||
color: 'rgba(0,0,0,1)', | ||
fontFamily: 'Circular Std', | ||
fontWeight: '500', | ||
fontSize: 17, | ||
opacity: 1, | ||
textAlign: 'center', | ||
borderBottomColor: 'rgba(0,0,0,1)', | ||
borderBottomWidth: 1, | ||
}, | ||
follow: { | ||
width: '50%', | ||
color: 'rgba(102,102,102,1)', | ||
fontFamily: 'Circular Std', | ||
fontWeight: '500', | ||
fontSize: 17, | ||
opacity: 1, | ||
textAlign: 'center', | ||
}, | ||
}); |
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,122 @@ | ||
import { Text, View } from 'react-native'; | ||
// import { Post } from '../../types/types'; | ||
// import Vote from './Vote'; | ||
// import { SvgXml } from 'react-native-svg'; | ||
|
||
type PostProps = { | ||
type: number; | ||
company: string; | ||
price: number; | ||
percent: number; | ||
}; | ||
|
||
const Info: React.FC<PostProps> = ({ type, company, price, percent }) => { | ||
if (type == 1) { | ||
return ( | ||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
paddingLeft: 15, | ||
paddingRight: 15, | ||
paddingTop: 10, | ||
paddingBottom: 10, | ||
backgroundColor: 'rgba(2, 173, 152, 0.10)', | ||
borderRadius: 5, | ||
width: 220, | ||
}}> | ||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
}}> | ||
<Text | ||
style={{ | ||
color: '#02AD98', | ||
fontSize: 16, | ||
fontFamily: 'SF Pro Text', | ||
fontWeight: '400', | ||
width: 40, | ||
}}> | ||
BUY | ||
</Text> | ||
<Text | ||
style={{ | ||
color: '#121212', | ||
fontSize: 16, | ||
fontFamily: 'SF Pro Text', | ||
fontWeight: '400', | ||
width: 120, | ||
}}> | ||
{company} @ {price} | ||
</Text> | ||
</View> | ||
<View> | ||
<Text | ||
style={{ | ||
color: '#02AD98', | ||
fontSize: 17, | ||
fontFamily: 'SF Pro', | ||
lineHeight: 20, | ||
}}> | ||
{percent}% | ||
</Text> | ||
</View> | ||
</View> | ||
); | ||
} | ||
if (type == 2) { | ||
return ( | ||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
paddingLeft: 15, | ||
paddingRight: 15, | ||
paddingTop: 10, | ||
paddingBottom: 10, | ||
backgroundColor: 'rgba(255, 43, 81, 0.1)', | ||
borderRadius: 5, | ||
width: 220, | ||
}}> | ||
<View | ||
style={{ | ||
flexDirection: 'row', | ||
}}> | ||
<Text | ||
style={{ | ||
color: '#FF2B51', | ||
fontSize: 16, | ||
fontFamily: 'SF Pro Text', | ||
fontWeight: '400', | ||
width: 40, | ||
}}> | ||
BUY | ||
</Text> | ||
<Text | ||
style={{ | ||
color: '#121212', | ||
fontSize: 16, | ||
fontFamily: 'SF Pro Text', | ||
fontWeight: '400', | ||
width: 120, | ||
}}> | ||
{company} @ {price} | ||
</Text> | ||
</View> | ||
<View> | ||
<Text | ||
style={{ | ||
color: '#FF2B51', | ||
fontSize: 17, | ||
fontFamily: 'SF Pro', | ||
lineHeight: 20, | ||
}}> | ||
17% | ||
</Text> | ||
</View> | ||
</View> | ||
); | ||
} | ||
}; | ||
|
||
// Define the styles for the component | ||
|
||
export default Info; |
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
Oops, something went wrong.