Skip to content

Commit

Permalink
Merge pull request #316 from ShivangiTiwari10/refactor/UI
Browse files Browse the repository at this point in the history
refactor: fix UI in profile page
  • Loading branch information
shreya-mishra authored Nov 7, 2023
2 parents c5a92fb + 0ad3081 commit 53adcbc
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions src/screens/ProfileScreen/ProfileScreen2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ActiveScreen = () => {
}, []),
);
return (
<View style={{ justifyContent: 'flex-start', alignItems: 'center' }}>
<View style={styles.profile}>
<DisplayContribution tasks={activeTasks} />
</View>
);
Expand Down Expand Up @@ -115,56 +115,32 @@ const ProfileScreen = () => {
};

const ProfileScreen2: React.FC = () => {
const tabNames = ['Noteworthy', 'Active ', 'All'];

const renderTab = ({ _name, active }: { _name: string; active: boolean }) => {
return (
// eslint-disable-next-line react/jsx-no-comment-textnodes
<View style={styles.tab}>
{tabNames.map((name) => (
<Text style={[styles.tabName, active && styles.activeTabName]}>
{name}
</Text>
))}
</View>
);
};

return (
<Tabs.Container renderHeader={ProfileScreen} renderTabBar={renderTab}>
<Tabs.Container renderHeader={ProfileScreen}>
<Tabs.Tab name="Noteworthy">
<Tabs.ScrollView style={{ flex: 1 }}>
<Tabs.ScrollView>
<Note />
</Tabs.ScrollView>
</Tabs.Tab>
<Tabs.Tab name="Active">
<Tabs.ScrollView style={{ flex: 1 }}>
<Tabs.ScrollView>
<ActiveScreen />
</Tabs.ScrollView>
</Tabs.Tab>
<Tabs.Tab name="All">
<Tabs.ScrollView style={{ flex: 1 }}>
<Tabs.ScrollView>
<All />
</Tabs.ScrollView>
</Tabs.Tab>
</Tabs.Container>
);
};

const styles = StyleSheet.create({
tab: {
flex: 1,
flexDirection: 'row',
justifyContent: 'space-around',
profile: {
justifyContent: 'flex-start',
alignItems: 'center',
},
tabName: {
fontSize: 16, // You can adjust the font size and other styles
fontWeight: 'bold',
padding: 20,
color: 'black', // Change the text color as needed
},
activeTabName: {
fontWeight: 'bold',
},
});

export default ProfileScreen2;

0 comments on commit 53adcbc

Please sign in to comment.