Improve the styling of the paging button in discover.js

This commit is contained in:
Nat 2021-04-10 13:40:38 -03:00
parent c1537a327b
commit d6fb9eb2e1
2 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import { View, Dimensions, Image } from "react-native"; import { View, Dimensions, Image } from "react-native";
import GridPostJsx from "src/components/posts/grid-post" import GridPostJsx from "src/components/posts/grid-post";
function partition(arr, size) { function partition(arr, size) {
let newArray = []; let newArray = [];

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { View, TouchableWithoutFeedback, Text } from "react-native"; import { View, TouchableOpacity, Text } from "react-native";
import GridViewJsx from "src/components/posts/grid-view"; import GridViewJsx from "src/components/posts/grid-view";
@ -60,16 +60,16 @@ const PagedGridJSX = (props) => {
} }
} /> } />
<View style = { styles.buttonContainer }> <View style = { styles.buttonContainer }>
<TouchableWithoutFeedback <TouchableOpacity
onPress = { () => { onPress = { () => {
// TODO: actually get more posts :) // TODO: actually get more posts :)
let morePosts = state.posts.concat(TEST_POSTS); let morePosts = state.posts.concat(TEST_POSTS);
setState({ posts: morePosts, loaded: true }); setState({...state, posts: morePosts});
} }> } }>
<View style = { styles.buttonMore }> <View style = { styles.buttonMore }>
<Text>Show more?</Text> <Text>Show more?</Text>
</View> </View>
</TouchableWithoutFeedback> </TouchableOpacity>
</View> </View>
</View> </View>
); );
@ -82,7 +82,8 @@ const styles = {
alignItems: "center" alignItems: "center"
}, },
buttonMore: { buttonMore: {
border: "2px solid black", borderWidth: 1,
borderColor: "#888",
borderRadius: 5, borderRadius: 5,
padding: 10, padding: 10,
margin: 20 margin: 20