-
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.
* profile page layout implemented. more stylings needs to be done, esp with the Edit Profile button. For that we will use a Pressable or TocuhOpacity component. * stylized to closely represent the mid-fi from Figma. still needs an Activity and Profile section. * Activity and Profile sections built. * implemented page scrolling on the profile page * linted * working on portfolio position list, temp commit * missing file * added position table * profile page updates, pos table * padding --------- Co-authored-by: Jakob Philippe <[email protected]>
- Loading branch information
1 parent
36ded09
commit aa3ba46
Showing
17 changed files
with
485 additions
and
71 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
import { View, Text, TouchableOpacity } from 'react-native' | ||
import React from 'react' | ||
import { Icon } from '@rneui/themed'; | ||
|
||
interface ActivityItemProps { | ||
title: string; | ||
description: string; | ||
icon: string; | ||
} | ||
|
||
const ActivityItem = ({ title, description, icon }: ActivityItemProps) => { | ||
return ( | ||
<View className='flex flex-row items-center p-4'> | ||
<View className='flex flex-row items-center flex-1 space-x-3'> | ||
<Icon type='material-community' name={icon} size={30} color='white' backgroundColor="#D5D5D5" style={{ | ||
padding: 10 | ||
}} /> | ||
<View className='flex flex-col flex-1 pr-3'> | ||
<Text className='font-medium' >{title}</Text> | ||
<Text className='text-[#535353] text-sm' numberOfLines={1} ellipsizeMode='tail'> | ||
{description} | ||
</Text> | ||
</View> | ||
</View> | ||
|
||
<TouchableOpacity className='bg-[#E7E7E7] rounded-lg px-2 py-2' > | ||
<Icon type='material-community' name='chevron-right' size={30} color='black' /> | ||
</TouchableOpacity> | ||
</View> | ||
) | ||
} | ||
|
||
export default ActivityItem |
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,86 @@ | ||
import { StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native' | ||
// import { theme } from '../../theme' | ||
import React from 'react' | ||
// import ActionButton from '../ActionButton' | ||
// import { useNavigation } from '@react-navigation/native' | ||
import ProfileBio from './ProfileBio' | ||
// import { useSession } from '@clerk/clerk-expo' | ||
|
||
interface ProfileBannerProps { | ||
user?: string | ||
} | ||
|
||
const ProfileBanner = ({ user }: ProfileBannerProps) => { | ||
/* | ||
const { session } = useSession() | ||
const navigation = useNavigation() | ||
const navigateToEditProfile = () => { | ||
navigation.navigate({ name: "Edit My Profile" }) | ||
} | ||
*/ | ||
|
||
return ( | ||
<View className='flex flex-col px-4 mb-2'> | ||
|
||
<View className='flex flex-row items-center justify-between gap-1 mb-4 mt-3'> | ||
<Image | ||
// must be a perfect circle | ||
className='w-32 h-32' | ||
style={profileStyles.profileImage} | ||
source={{ uri: "currentAuth?.photoURL" }} | ||
/> | ||
|
||
<View className='flex flex-col items-center flex-1 gap-2'> | ||
<View className='flex flex-row justify-evenly flex-1' > | ||
|
||
<View className='flex flex-col items-center px-4 py-2'> | ||
<Text className='text-sm font-semibold'>10</Text> | ||
<Text className='text-sm font-semibold'> | ||
Followers | ||
</Text> | ||
</View> | ||
|
||
<View className='flex flex-col items-center px-4 py-2'> | ||
<Text className='text-sm font-semibold'>{10}</Text> | ||
<Text adjustsFontSizeToFit={true} numberOfLines={1} className='text-sm font-semibold'> | ||
Following | ||
</Text> | ||
</View> | ||
</View> | ||
|
||
<TouchableOpacity | ||
className='flex items-center justify-center flex-1 mb-5 w-48' | ||
style={profileStyles.followButton} | ||
onPress={() => console.log(user)} | ||
> | ||
<Text className='font-semibold text-[#02AD98]'>Edit Profile</Text> | ||
</TouchableOpacity> | ||
</View> | ||
</View> | ||
|
||
<ProfileBio | ||
fullName="first_name last_name" | ||
description="profile description? Lorem ipsum dolor sit amet, consectetur adipiscing elit.Praesent vel nisi sed diam ultricies viverra sit amet nec dolor...." | ||
/> | ||
|
||
</View> | ||
) | ||
} | ||
|
||
export default ProfileBanner | ||
|
||
|
||
const profileStyles = StyleSheet.create({ | ||
profileImage: { | ||
borderRadius: 180, | ||
borderColor: "black", | ||
borderWidth: 2, | ||
}, | ||
followButton: { | ||
backgroundColor: "rgba(2, 173, 152, 0.18)", | ||
paddingVertical: 5, | ||
paddingHorizontal: 20, | ||
borderRadius: 5 | ||
}, | ||
}) |
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,18 @@ | ||
import { View, Text } from 'react-native' | ||
import React from 'react' | ||
|
||
interface ProfileBioProps { | ||
fullName: string | ||
description: string | ||
} | ||
|
||
const ProfileBio = ({ fullName, description }: ProfileBioProps) => { | ||
return ( | ||
<View className='flex flex-col space-y-1 w-96'> | ||
<Text className='text-base font-bold'>{fullName}</Text> | ||
<Text>{description}</Text> | ||
</View> | ||
) | ||
} | ||
|
||
export default ProfileBio |
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,25 @@ | ||
import { View, Text, Pressable } from 'react-native' | ||
import React from 'react' | ||
|
||
interface ProfilePerformanceProps { | ||
portfolioValue: number | ||
} | ||
|
||
const ProfilePerformance = ({portfolioValue} : ProfilePerformanceProps) => { | ||
return ( | ||
<View className='flex flex-col justify-between space-y-1 py-3 px-6 border-b-[1px] border-b-gray-200'> | ||
<Text className='font-semibold text-base'>Performance</Text> | ||
<View className='flex flex-row justify-between items-center'> | ||
<Text className={`text-2xl ${portfolioValue >= 0 ? 'text-[#02AD98]' : 'text-[#FF2B51]'}`}> | ||
{portfolioValue} % | ||
</Text> | ||
<Pressable> | ||
<Text>Copy Trades</Text> | ||
</Pressable> | ||
</View> | ||
<Text>YTD Performance</Text> | ||
</View> | ||
) | ||
} | ||
|
||
export default ProfilePerformance |
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,49 @@ | ||
import { DataTable } from 'react-native-paper'; | ||
import { prettifyMoney } from '../services/utils'; | ||
import { Text, View } from 'react-native'; | ||
import React from 'react'; | ||
import { Position } from '../types/types'; | ||
|
||
interface ProfilePositionsProps { | ||
positions: Position[] | undefined | ||
} | ||
|
||
export const ProfilePositions = ({positions}: ProfilePositionsProps) => { | ||
return ( | ||
<View > | ||
<DataTable> | ||
<DataTable.Header> | ||
<DataTable.Title>Symbol</DataTable.Title> | ||
<DataTable.Title>Last Price</DataTable.Title> | ||
<DataTable.Title>Mkt Val / Qty</DataTable.Title> | ||
<DataTable.Title>Open P/L</DataTable.Title> | ||
</DataTable.Header> | ||
{positions?.map((position, index) => ( | ||
<DataTable.Row key={index}> | ||
<DataTable.Cell>{position.ticker}</DataTable.Cell> | ||
<DataTable.Cell>{prettifyMoney(position.cost)}</DataTable.Cell> | ||
<DataTable.Cell> | ||
<View className='flex flex-col'> | ||
<Text> | ||
{prettifyMoney(position.cost * position.quantity)} | ||
</Text> | ||
<Text> | ||
{prettifyMoney(position.quantity)} | ||
</Text> | ||
</View> | ||
</DataTable.Cell> | ||
<DataTable.Cell> | ||
<View className='flex flex-col'> | ||
<Text className={position.total_gain >= 0 ? 'text-[#02ad99]' : 'text-[#fe2b51]'}> | ||
{prettifyMoney(position.total_gain)} | ||
</Text> | ||
<Text className={position.total_gain >= 0 ? 'text-[#02ad99]' : 'text-[#fe2b51]'}> | ||
{position.total_gain_pct}% | ||
</Text> | ||
</View> | ||
</DataTable.Cell> | ||
</DataTable.Row> | ||
))} | ||
</DataTable> | ||
</View> | ||
)} |
Oops, something went wrong.