import React from "react-native";
import Page from "./page";

const {
    StyleSheet,
    View,
    Text,
    Image,
    TouchableOpacity
} = React;

const styles = StyleSheet.create({
    failed: {
        fontSize: 18
    },
    button: {
        flexDirection: "row",
        alignItems: "center",
        padding: 16
    },
    label: {
        paddingHorizontal: 8,
        marginLeft: 8
    },
    icon: {
        height: 24,
        width: 24,
        opacity: 0.5
    }
});

export default class PageRetry extends React.Component {
    render() {
        return (
            <Page {...this.props}>
                <Text style={styles.failed}>Failed to load data</Text>
                {this.props.onRetry ?
                    <TouchableOpacity onPress={this.props.onRetry}>
                        <View style={styles.button}>
                            <Image style={styles.icon} source={require("image!ic_refresh_black")} />
                            <Text style={styles.label}>Retry</Text>
                        </View>
                    </TouchableOpacity> :
                    null
                }
            </Page>
        );
    }
}

PageRetry.propTypes = {
    onRetry: React.PropTypes.func
};

@@ -178,16 +178,120 @@
 reate(%7B%0A
+    container: %7B%0A        flex: 1,%0A        alignItems: %22center%22,%0A        justifyContent: %22center%22%0A    %7D,%0A
     fail
@@ -486,12 +486,18 @@
 rgin
-Left
+Horizontal
 : 8%0A
@@ -710,16 +710,109 @@
 props%7D%3E%0A
+                %3CTouchableOpacity onPress=%7Bthis.props.onRetry%7D style=%7Bstyles.container%7D%3E%0A    
         
@@ -894,76 +894,12 @@
     
-%7Bthis.props.onRetry ?%0A                    %3CTouchableOpacity onPress=
+    
 %7Bthi
@@ -913,23 +913,19 @@
 .onRetry
-%7D%3E%0A    
+ ?%0A
         
@@ -965,20 +965,16 @@
 utton%7D%3E%0A
-    
         
@@ -1078,36 +1078,32 @@
                 
-   
- 
 %3CText style=%7Bsty
@@ -1150,19 +1150,17 @@
     
-    
 %3C/View%3E
+ :
 %0A   
@@ -1180,29 +1180,12 @@
     
-%3C/TouchableOpacity%3E :
+null
 %0A   
@@ -1193,32 +1193,25 @@
             
-    null
+%7D
 %0A           
@@ -1207,33 +1207,51 @@
                 
-%7D
+%3C/TouchableOpacity%3E
 %0A            %3C/P

Make the whole retry page tappable