-
Notifications
You must be signed in to change notification settings - Fork 4
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
Sponsors Page #95
Open
dxn7335
wants to merge
7
commits into
TekkenChicken:develop
Choose a base branch
from
dxn7335:feature/sponsors-page
base: develop
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
Sponsors Page #95
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
abc4c0d
Minor App cleanup
dxn7335 a8ed9ec
Create a CopyText Button component
dxn7335 aea327d
Add Sponsors Page to Drawer Navigation and needed Assets
dxn7335 6fb6268
Create Sponsors Page and Sponsor item Component
dxn7335 d382431
Add Sponsors Page content (NEEDS UPDATING)
dxn7335 6383809
Add bottom page break
dxn7335 315d47c
Fix indentation
dxn7335 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
// dependencies | ||
import { View, Text, TouchableHighlight, StyleSheet, Clipboard , Animated, Easing } from 'react-native'; | ||
import CustomText from '../CustomText/CustomText'; | ||
|
||
import * as Colors from '../../style/vars/colors'; | ||
|
||
class CopyTextButton extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
copied: new Animated.Value(0) | ||
}; | ||
} | ||
|
||
onCopyToClipboard(text) { | ||
Clipboard.setString(text); | ||
this.animateAlert(); | ||
} | ||
|
||
animateAlert() { | ||
const endVal = (this.state.copied._value === 0) ? 1 : 0; | ||
Animated.timing( | ||
this.state.copied, | ||
{ | ||
toValue: endVal, | ||
duration: 200, | ||
easing: Easing.inout | ||
} | ||
).start(() => { | ||
if (this.state.copied._value === 1) { | ||
setTimeout(() => this.animateAlert(), 1000); | ||
} | ||
}); | ||
} | ||
|
||
render() { | ||
const {text, buttonStyle, textStyle} = this.props; | ||
|
||
const transition = this.state.copied.interpolate({ | ||
inputRange: [0, 1], | ||
outputRange: [60, 45] | ||
}); | ||
|
||
return ( | ||
<View> | ||
<TouchableHighlight | ||
style={[Styles.initialButton, buttonStyle]} | ||
onPress={() => this.onCopyToClipboard(text)}> | ||
<View> | ||
<CustomText textStyle={[Styles.initialText, textStyle]}>{text}</CustomText> | ||
</View> | ||
</TouchableHighlight> | ||
|
||
<Animated.View | ||
style={[Styles.copyAlert, {opacity: this.state.copied, top: transition}]}> | ||
<CustomText textStyle={[Styles.initialText, Styles.copyAlertText]}>Copied to Clipboard</CustomText> | ||
</Animated.View> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
const Styles = StyleSheet.create({ | ||
initialButton: { | ||
padding: 10, | ||
paddingLeft: 15, | ||
paddingRight: 15, | ||
backgroundColor: Colors.darkMaroon | ||
}, | ||
initialText: { | ||
fontWeight: '600', | ||
textAlign: 'center' | ||
}, | ||
copyAlert: { | ||
position: 'absolute', | ||
backgroundColor: "#000", | ||
borderRadius: 15, | ||
padding: 8, | ||
paddingLeft: 30, | ||
paddingRight: 30, | ||
overflow: 'hidden', | ||
alignSelf: 'center' | ||
}, | ||
copyAlertText: { | ||
fontWeight: '400', | ||
fontSize: 12 | ||
} | ||
}) | ||
|
||
CopyTextButton.propTypes = { | ||
text: PropTypes.string, | ||
/* | ||
Styling props | ||
============= | ||
buttonStyle: Button container Styling | ||
textStyle: title Styling | ||
*/ | ||
}; | ||
|
||
export default CopyTextButton; |
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"page": { | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ante velit, semper quis ante quis, iaculis sollicitudin nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas." | ||
}, | ||
"sponsors": [ | ||
{ | ||
"name": "Controller Chaos", | ||
"description": "Get some badass skins for your gaming peripherals. Pick something from their wide selection or have something made specifically for you.", | ||
"url": "", | ||
"discountCode": "ABC1234", | ||
"image_id": "controller_chaos" | ||
}, | ||
{ | ||
"name": "Focus Attack", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ante velit, semper quis ante quis, iaculis sollicitudin nibh.", | ||
"url": "", | ||
"discountCode": "ABC1234", | ||
"image_id": "focus_attack" | ||
}, | ||
{ | ||
"name": "Qanba", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ante velit, semper quis ante quis, iaculis sollicitudin nibh.", | ||
"url": "", | ||
"discountCode": "ABC1234", | ||
"image_id": "qanba" | ||
} | ||
] | ||
} |
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,57 @@ | ||
import React from 'react'; | ||
import { View, Text, ScrollView } from 'react-native'; | ||
import { Styles } from './styles'; | ||
import { SponsorsNavHeader } from '../../components/NavigationBar'; | ||
import CustomText from '../../components/CustomText/CustomText'; | ||
import LinearGradient from 'react-native-linear-gradient'; | ||
import SponsorItem from './sponsorItem'; | ||
|
||
import * as Colors from '../../style/vars/colors'; | ||
|
||
// Page and Sponsor Content | ||
import content from './content.json'; | ||
|
||
class Sponsors extends React.Component { | ||
static navigationOptions = ({navigation}) => { | ||
const headerLeft = [ | ||
{ | ||
key: "MenuButton", | ||
onPress: () => navigation.navigate('DrawerOpen') | ||
} | ||
]; | ||
return SponsorsNavHeader(headerLeft); | ||
}; | ||
|
||
/** | ||
* @method renderSponsors | ||
* @param {array} sponsors | ||
* @return {<SponsorItems/>} | ||
* Takes in sponsors array and renders out sponsor-item components | ||
*/ | ||
renderSponsors(sponsors) { | ||
return (<View> | ||
{ | ||
sponsors.map((sponsor, i) => <SponsorItem key={i} {...sponsor} />) | ||
} | ||
</View>) | ||
} | ||
|
||
render() { | ||
const {page, sponsors} = content; | ||
|
||
return ( | ||
<LinearGradient | ||
colors={[Colors.redPrimary, Colors.redSecondary]} | ||
start={{x: 0.5, y: 0.1}} end={{x: 1.0, y: 0.9}} | ||
style={Styles.container}> | ||
<ScrollView style={Styles.scrollContainer}> | ||
<CustomText textStyle={Styles.commonText}>{page.description}</CustomText> | ||
{this.renderSponsors(sponsors)} | ||
<CustomText textStyle={[Styles.commonText, {textAlign: 'center'}]}>___</CustomText> | ||
</ScrollView> | ||
</LinearGradient> | ||
) | ||
} | ||
} | ||
|
||
export default Sponsors; |
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.
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.
lol