diff --git a/frontend/components/Feed/FeedTopBar.tsx b/frontend/components/Feed/FeedTopBar.tsx index 1c95f33a..09eb3818 100644 --- a/frontend/components/Feed/FeedTopBar.tsx +++ b/frontend/components/Feed/FeedTopBar.tsx @@ -1,8 +1,8 @@ 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 FeedPage from '../../pages/FeedPage'; +import Follow from '../../pages/Follow'; import { AuthNavigationProp } from '../../types/navigationTypes'; type FeedBarProps = { @@ -14,12 +14,10 @@ const FeedTopBar: React.FC = ({ tab, setTab }) => { const navigation = useNavigation(); const handleButtonPress = () => { - setTab('Explore') navigation.navigate('Feed'); }; const handleButtonPress2 = () => { - setTab('Explore') navigation.navigate('Follow'); }; diff --git a/frontend/components/Feed/Info.tsx b/frontend/components/Feed/Info.tsx index aad5286a..d4d33aae 100644 --- a/frontend/components/Feed/Info.tsx +++ b/frontend/components/Feed/Info.tsx @@ -117,6 +117,4 @@ const Info: React.FC = ({ type, company, price, percent }) => { } }; -// Define the styles for the component - export default Info; diff --git a/frontend/components/Feed/PostNew.tsx b/frontend/components/Feed/PostNew.tsx index e1db8737..dfbec2b2 100644 --- a/frontend/components/Feed/PostNew.tsx +++ b/frontend/components/Feed/PostNew.tsx @@ -62,15 +62,15 @@ const PostNew: React.FC = ({ post }) => { {post.num_data < 250 ? ( ) : ( )} diff --git a/frontend/pages/FeedPage.tsx b/frontend/pages/FeedPage.tsx index a605fb4c..074091fd 100644 --- a/frontend/pages/FeedPage.tsx +++ b/frontend/pages/FeedPage.tsx @@ -25,8 +25,8 @@ const AddSvg = ` const FeedPage = () => { const [search, setSearch] = useState(''); - const [tab, setTab] = useState('Explore') - const [firstPost, setFirstPost] = useState(null) + const [tab, setTab] = useState('Explore'); + const [firstPost, setFirstPost] = useState(null); const [posts, setPosts] = useState([]); const handleSearchChange = (text: string) => { @@ -35,11 +35,20 @@ const FeedPage = () => { useEffect(() => { getPosts().then(data => { - setFirstPost(data[0]) + setFirstPost(data[0]); setPosts(data.slice(1)); }); }, []); + + const [yes, setYes] = useState(1); + const handleClick1 = () => { + setYes(2); + }; + + const handleClick2 = () => { + setYes(1); + const dispatch = useDispatch(); const startMakePost = () => { @@ -49,63 +58,102 @@ const FeedPage = () => { return ( - + {/* */} + Explore + + + + Following + + + - - - { - firstPost && - - Featured Post - - - } - - - ] - }, - { - data: [ - - - - ] - }, - { - data: [ - - { - posts.map((p) => ( - - )) - } - - ] - }, - { - data: [ - - ] - } - - ]} - keyExtractor={(_, index) => index.toString()} - renderItem={({ item }) => <>{item}} - renderSectionHeader={() => } - stickySectionHeadersEnabled={false} - /> + {yes == 1 ? ( + + {firstPost && ( + + Featured Post + + + )} + , + ], + }, + { + data: [ + + + , + ], + }, + { + data: [ + + {posts.map(p => ( + + ))} + , + ], + }, + { + data: [], + }, + ]} + keyExtractor={(_, index) => index.toString()} + renderItem={({ item }) => <>{item}} + renderSectionHeader={() => } + stickySectionHeadersEnabled={false} + /> + ) : ( + + {firstPost && ( + + Featured Post + + + )} + , + ], + }, + { + data: [ + + {posts.map(p => ( + + ))} + , + ], + }, + { + data: [], + }, + ]} + keyExtractor={(_, index) => index.toString()} + renderItem={({ item }) => <>{item}} + renderSectionHeader={() => } + stickySectionHeadersEnabled={false} + /> + )} - { onChangeText={handleSearchChange} placeholder="Search" /> - @@ -128,13 +175,54 @@ export default FeedPage; const styles = StyleSheet.create({ container: { // boxSizing: 'border-box', - flexDirection: "column", - height: "100%", + flexDirection: 'column', + height: '100%', flex: 1, - backgroundColor: "#FFFFFF" + backgroundColor: '#FFFFFF', }, top_bar: { flex: 1, + // width: 393, + // height: 65, + // backgroundColor: '#F7F7F7', + // // backgroundRepeat: 'no-repeat', + // // backgroundPosition: 'center center', + // // backgroundSize: 'cover', + // padding: 20, + // margin: 100, + // position: 'absolute', + // top: -49, + // left: -100, + // overflow: 'hidden', + // zIndex: 2, + }, + explore: { + width: 67, + color: 'rgba(0,0,0,1)', + position: 'absolute', + top: 75, + left: 55, + // top: 30, + // left: 55, + // fontFamily: 'Circular Std', + fontWeight: '500', + fontSize: 17, + opacity: 1, + textAlign: 'center', + }, + follow: { + width: 83, + color: 'rgba(102,102,102,1)', + position: 'absolute', + top: 75, + right: 75, + // top: 30, + // right: 65, + // fontFamily: 'Circular Std', + fontWeight: '500', + fontSize: 17, + opacity: 1, + textAlign: 'center', }, end: { height: 100, @@ -150,14 +238,14 @@ const styles = StyleSheet.create({ opacity: 1, textAlign: 'left', paddingTop: 15, -}, + }, scroll_view: { flexDirection: 'column', paddingHorizontal: 25, //flex: 10, //height: "100%", - paddingTop: "15%", - paddingBottom: "50%" + paddingTop: '15%', + paddingBottom: '50%', }, body: { fontSize: 14, @@ -167,19 +255,19 @@ const styles = StyleSheet.create({ color: '#fff', }, post_pos: { - marginTop: "15%", + marginTop: '15%', width: '100%', // background: 'url("../images/v124_1268.png")', // backgroundRepeat: 'no-repeat', // backgroundPosition: 'center center', // backgroundSize: 'cover', opacity: 1, - flexDirection: "column" + flexDirection: 'column', // position: 'absolute', }, post_txt: { - marginTop: "20%", - width: "100%", + marginTop: '20%', + width: '100%', color: 'rgba(102,102,102,1)', fontFamily: 'Circular Std', marginBottom: 12, @@ -189,7 +277,7 @@ const styles = StyleSheet.create({ textAlign: 'center', }, posts: { - width: "100%", + width: '100%', // background: 'url("../images/v124_1270.png")', // backgroundRepeat: 'no-repeat', // backgroundPosition: 'center center', @@ -198,7 +286,7 @@ const styles = StyleSheet.create({ overflow: 'hidden', }, ppl_sec: { - width: "100%", + width: '100%', // background: 'url("../images/v124_1286.png")', // backgroundRepeat: 'no-repeat', // backgroundPosition: 'center center', @@ -220,7 +308,7 @@ const styles = StyleSheet.create({ overflow: 'hidden', }, search_box: { - width: "90%", + width: '90%', height: 48, backgroundColor: 'rgba(247,247,247,1)', opacity: 1, @@ -231,7 +319,7 @@ const styles = StyleSheet.create({ overflow: 'hidden', }, search_txt: { - width: "100%", + width: '100%', color: 'rgba(0,0,0,1)', position: 'absolute', paddingRight: 12, @@ -251,7 +339,7 @@ const styles = StyleSheet.create({ right: 22, zIndex: 5, overflow: 'hidden', - shadowColor: "#666666", + shadowColor: '#666666', // paddingHorizontal: 20, }, horizontalLine: { @@ -290,4 +378,32 @@ const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, + follow_but: { + width: 200, + height: 65, + // backgroundRepeat: 'no-repeat', + // backgroundPosition: 'center center', + // backgroundSize: 'cover', + padding: 20, + margin: 100, + position: 'absolute', + top: -50, + right: -100, + overflow: 'hidden', + zIndex: 1, + }, + explore_but: { + width: 200, + height: 65, + // backgroundRepeat: 'no-repeat', + // backgroundPosition: 'center center', + // backgroundSize: 'cover', + padding: 20, + margin: 100, + position: 'absolute', + top: -50, + left: -100, + overflow: 'hidden', + zIndex: 1, + }, }); diff --git a/frontend/pages/Follow.tsx b/frontend/pages/Follow.tsx index fe398e90..c4071d7c 100644 --- a/frontend/pages/Follow.tsx +++ b/frontend/pages/Follow.tsx @@ -3,7 +3,6 @@ import React, { useEffect, useState } from 'react'; import { SvgXml } from 'react-native-svg'; import { SectionList } from 'react-native'; import FeedTopBar from '../components/Feed/FeedTopBar'; -//import DiscoverPeople from '../components/Feed/DiscoverPeople'; import PostNew from '../components/Feed/PostNew'; import { getPosts } from '../services/users'; import { Post } from '../types/types'; diff --git a/frontend/types/navigationTypes.ts b/frontend/types/navigationTypes.ts index d08b0e05..58b0c438 100644 --- a/frontend/types/navigationTypes.ts +++ b/frontend/types/navigationTypes.ts @@ -26,7 +26,6 @@ export type ProfileOtherStack = { Profile: undefined | { screen: "FollowerProfile"; params: { user: User } }; }; - export type MakePostParamList = { SharePost: undefined; SelectTrade: undefined; diff --git a/frontend/types/types.d.ts b/frontend/types/types.d.ts index eb04465b..0c92b1b9 100644 --- a/frontend/types/types.d.ts +++ b/frontend/types/types.d.ts @@ -153,6 +153,6 @@ enum TradeType { } export enum PostType { ONE_MONTH_SUMMARY = '1 month summary', - RECENT_TRADE = 'Recent Trade', + RECENT_TRADE = 'Recent trade', SHARE_COMMENT = 'Share comment' }