-
Notifications
You must be signed in to change notification settings - Fork 45
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
fixes #311 #315
Open
aleksandr-wemakesoftware
wants to merge
9
commits into
letsdoitworld:react-native-app-prototype
Choose a base branch
from
aleksandr-wemakesoftware:react-native-teams
base: react-native-app-prototype
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
fixes #311 #315
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7ac5e14
WIP teams
aleksandr-wemakesoftware 194fd84
team trashpoints list and pr fixes
779f4dd
more fixes from review
lynxlynxlynx 6a8e2ba
team in profile and refetching team data after joining
df5840b
team icon in profile
9058ce2
#300, #301 bugfix
aleksandr-wemakesoftware f419ecd
placeholder in team tab when user is not logged in
d2d983b
trashpoints counter in team details
aea9687
Merge branch 'react-native-app-prototype' into react-native-teams
aleksandr-wemakesoftware 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import { ButtonDelete } from '../../assets/images'; | |
import { COUNTRIES_HASH } from '../../shared/countries'; | ||
import { Backgrounds } from '../../assets/images'; | ||
import { TEAM_SCREEN } from '../index'; | ||
import { Button } from '../../components/Button'; | ||
|
||
export default class Teams extends Component { | ||
|
||
|
@@ -97,7 +98,19 @@ export default class Teams extends Component { | |
<Text style={styles.lowerText}>{strings.label_text_noteams_bottom}</Text> | ||
</View> | ||
); | ||
|
||
|
||
renderGuestTeams = () => { | ||
return ( | ||
<View style={styles.guestContainer}> | ||
<View style={styles.imgPlaceholder} /> | ||
<Button | ||
onPress={this.props.onGuestLogIn} | ||
text="Log In" | ||
/> | ||
</View> | ||
) | ||
} | ||
|
||
spinner = () => { | ||
return ( | ||
<ActivityIndicator | ||
|
@@ -109,12 +122,15 @@ export default class Teams extends Component { | |
}; | ||
|
||
componentDidMount() { | ||
const { onFetchTeams } = this.props; | ||
onFetchTeams(); | ||
const { onFetchTeams, isAuthenticated, isGuestSession } = this.props; | ||
if (isAuthenticated && !isGuestSession) { | ||
onFetchTeams(); | ||
} | ||
} | ||
|
||
render() { | ||
const { teams, loading } = this.props; | ||
const { teams, loading, isAuthenticated, isGuestSession } = this.props; | ||
if (!isAuthenticated && isGuestSession) return this.renderGuestTeams(); | ||
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. Please, add PropTypes for teams, loading, isAuthenticated, isGuestSession |
||
return ( | ||
<View style={styles.container}> | ||
{this.renderSearchField()} | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can counter be non-numeric or why is this check needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zero value will be treated as falsy and React will try to render it outside of Text tag, which will cause an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but the check allows any truthy value or zero, only excluding null and undefined. If those values are not possible, the whole check is redundant.