-
Notifications
You must be signed in to change notification settings - Fork 0
Teams #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Eshchock1
wants to merge
11
commits into
development
Choose a base branch
from
teams
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Teams #29
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3fa446b
displaying user's team stats on teams page
Eshchock1 3ed724c
completed cardlist for team cards and added more teams to mocks
Eshchock1 e112764
installed and incorporated react tooltips for team cards
Eshchock1 1756fb6
incorporated search bar on teams page
Eshchock1 4f658d0
functional search bar that filters teams
Eshchock1 f0c89c5
added favourite button to tea cards
Eshchock1 19ea6a2
created sort by bar
Eshchock1 ab6b64b
teamDetails page create and can be navigated to using teamStack
Eshchock1 629e51a
sending information from cardlist to teamDetails
Eshchock1 e8adb1a
completed team details page with stats, details, and favourate button
Eshchock1 5052e77
small error fixes on teams and teamdetails before pr
Eshchock1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,106 @@ | ||
| import React, { ReactNode, ReactComponentElement, ReactElement, useState, useEffect} from 'react'; | ||
| import {StyleSheet, TouchableOpacity} from 'react-native'; | ||
| import { TouchableHighlight } from 'react-native-gesture-handler'; | ||
| import {Text, Block} from '../index'; | ||
| import * as theme from '../../constants/theme'; | ||
| import { Tooltip} from 'react-native-elements'; | ||
| import FontAwesome from 'react-native-vector-icons/FontAwesome'; | ||
|
|
||
|
|
||
| type ComponentFn = () => JSX.Element; | ||
|
|
||
| export interface CardProps { | ||
| key: string, | ||
| leftHeader: string | ComponentFn; | ||
| rightHeader: string | ComponentFn; | ||
| leftBody: string | ComponentFn; | ||
| rightBody: string | ComponentFn; | ||
| rightContent: Array<any>; | ||
| favourite: boolean; | ||
| } | ||
|
|
||
| const Card = (props: CardProps) => { | ||
| const toggleFavourite = () => { | ||
| if (isFavourite) { | ||
| setFavouriteButtonStatus(favouriteButtonDisabled); | ||
| isFavourite = false; | ||
| } | ||
| else { | ||
| setFavouriteButtonStatus(favouriteButtonEnabled); | ||
| isFavourite = true; | ||
| } | ||
| } | ||
| const leftBody = (typeof props.leftBody === "string") ? () => <Text h3 white style={{marginHorizontal:6, fontSize: 20}}>{props.leftBody}</Text>: props.leftBody; | ||
| const rightHeader = (typeof props.rightHeader === "string") ? () => <Text h3 style={{fontSize:22,}}numberOfLines={2}>{props.rightHeader}</Text> : props.rightHeader; | ||
| const rightBody = (typeof props.rightBody === "string") ? () => <Text light style={{fontSize:15,}}>{props.rightBody}</Text> : props.rightBody; | ||
| const favouriteButtonDisabled = <TouchableOpacity style={{position:"absolute", top:-10, right:-25,}} onPress={toggleFavourite}><FontAwesome name="star-o" size={25} color="gold" style={{padding:10,}}/></TouchableOpacity> | ||
| const favouriteButtonEnabled = <TouchableOpacity style={{position:"absolute", top:-10, right:-25,}} onPress={toggleFavourite}><FontAwesome name="star" size={25} color="gold" style={{padding:10,}}/></TouchableOpacity> | ||
| const [favouriteButtonStatus, setFavouriteButtonStatus] = useState(favouriteButtonDisabled); | ||
| let isFavourite = false; | ||
|
|
||
| useEffect(() => { | ||
| if (props.favourite) { | ||
| isFavourite = true; | ||
| setFavouriteButtonStatus(favouriteButtonEnabled); | ||
| } | ||
| else { | ||
| setFavouriteButtonStatus(favouriteButtonDisabled); | ||
| } | ||
| }, []); | ||
|
|
||
|
|
||
|
|
||
| return ( | ||
| <Block | ||
| row card shadow color={theme.colors.white} style={styles.request}> | ||
| <Block | ||
| flex={0.2} | ||
| card | ||
| column | ||
| color="secondary" | ||
| style={styles.requestStatus}> | ||
| <Block flex={1} middle center color={theme.colors.secondary}> | ||
| <Text h3 style={{color:"white", fontSize:12,}}>Rank</Text> | ||
| {leftBody()} | ||
| </Block> | ||
| </Block> | ||
| <Block flex={0.75} column middle> | ||
| {favouriteButtonStatus} | ||
| <Block style={{justifyContent:"flex-start", paddingTop:5,}}> | ||
| {rightHeader()} | ||
| {rightBody()} | ||
| </Block> | ||
| <Block> | ||
| <Block style={{flexDirection:'row', flexWrap:'wrap'}}> | ||
| <Tooltip backgroundColor="white" overlayColor="rgba(0,0,0,0.15)" skipAndroidStatusBar={true} popover={<Text>Average placement</Text>}> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reuse code |
||
| <TouchableHighlight style={{width:30, height:30, borderRadius:30, marginRight:5, marginTop:5, backgroundColor:theme.colors.primary,justifyContent:'center',}}><Text h3 color="white" style={{textAlign:"center", fontSize:14,}}>{props.rightContent[0]}</Text></TouchableHighlight> | ||
| </Tooltip> | ||
| <Tooltip backgroundColor="white" overlayColor="rgba(0,0,0,0.15)" skipAndroidStatusBar={true} popover={<Text>Average PPG</Text>}> | ||
| <TouchableHighlight style={{width:30, height:30, borderRadius:30, marginRight:5, marginTop:5, backgroundColor:theme.colors.primary,justifyContent:'center',}}><Text h3 color="white" style={{textAlign:"center", fontSize:14,}}>{props.rightContent[1]}</Text></TouchableHighlight> | ||
| </Tooltip> | ||
| <Tooltip backgroundColor="white" overlayColor="rgba(0,0,0,0.15)" skipAndroidStatusBar={true} popover={<Text>Total Awards</Text>}> | ||
| <TouchableHighlight style={{width:30, height:30, borderRadius:30, marginRight:5, marginTop:5, backgroundColor:theme.colors.primary,justifyContent:'center',}}><Text h3 color="white" style={{textAlign:"center", fontSize:14,}}>{props.rightContent[2]}</Text></TouchableHighlight> | ||
| </Tooltip> | ||
| <Tooltip backgroundColor="white" overlayColor="rgba(0,0,0,0.15)" skipAndroidStatusBar={true} popover={<Text>Best Skills Score</Text>}> | ||
| <TouchableHighlight style={{width:30, height:30, borderRadius:30, marginRight:5, marginTop:5, backgroundColor:theme.colors.primary,justifyContent:'center',}}><Text h3 color="white" style={{textAlign:"center", fontSize:14,}}>{props.rightContent[3]}</Text></TouchableHighlight> | ||
| </Tooltip> | ||
| </Block> | ||
| </Block> | ||
| </Block> | ||
| </Block> | ||
| ) | ||
| }; | ||
|
|
||
| export default Card; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| requests: { | ||
| marginTop: -55, | ||
| paddingTop: 55 + 20, | ||
| paddingHorizontal: 15, | ||
| zIndex: -1, | ||
| }, | ||
| requestsHeader: {paddingHorizontal: 15, paddingBottom: 15}, | ||
| request: {padding: 15, marginBottom: 15}, | ||
| requestStatus: {marginRight: 20, overflow: 'hidden',}, | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.