Archived
Proof: Prevent charge if no membershiptype
This commit is contained in:
1 parent
f65f29a0f3
commit
d4b81ff8e8
4 files changed
+15
-3
No files matched your search
@@ -4,6 +4,14 @@ import {Button, Text as NBText} from "native-base";
|
||||
import theme from "../../theme";
|
||||
export default class Membership extends Component {
|
||||
render() {
|
||||
if (this.props.isFetchingUserData) {
|
||||
return (
|
||||
<View style={styles.card}>
|
||||
<Spinner color="#f58220"/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView>
|
||||
<View style={styles.card}>
|
||||
|
||||
@@ -62,7 +62,11 @@ class MembershipContainer extends Component {
|
||||
onLogoutPress={this.onLogoutPress}
|
||||
/>;
|
||||
}
|
||||
return <Membership onLoginPress={this.onLoginPress} onRegisterPress={this.onRegisterPress} />;
|
||||
return <Membership
|
||||
isFetchingUserData={this.props.isFetchingUserData}
|
||||
onLoginPress={this.onLoginPress}
|
||||
onRegisterPress={this.onRegisterPress}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ export default class Proof extends Component {
|
||||
<Button
|
||||
onPress={this.props.onChargePress}
|
||||
full
|
||||
disabled={this.props.isChargingMembership}
|
||||
disabled={this.props.isChargingMembership || this.props.isLoadingMembershipType}
|
||||
style={styles.purchaseButton}
|
||||
>
|
||||
<NBText>{`Kjøp medlemskap (${this.props.membershipPrice} NOK)`}</NBText>
|
||||
|
||||
@@ -15,7 +15,6 @@ stripe.init({
|
||||
|
||||
|
||||
class ProofContainer extends Component {
|
||||
// TODO: Prevent charge if we do not have a default membership type
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -36,6 +35,7 @@ class ProofContainer extends Component {
|
||||
{...this.state}
|
||||
user={this.props.user}
|
||||
isChargingMembership={this.props.isChargingMembership}
|
||||
isLoadingMembershipType={this.props.data.loading}
|
||||
chargeError={this.props.chargeError}
|
||||
onChargePress={this.openStripe}
|
||||
onLogoutPress={this.props.onLogoutPress}
|
||||
|
||||
Reference in new issue
Block a user