Improved dashboard item size

This commit is contained in:
Arnaud Vergnet 2020-07-21 22:40:24 +02:00
parent ccf196abaa
commit 8864e686bd
2 changed files with 12 additions and 7 deletions

View file

@ -39,8 +39,8 @@ class SmallDashboardItem extends React.Component<Props> {
onPress={this.props.onPress} onPress={this.props.onPress}
borderless={true} borderless={true}
style={{ style={{
marginLeft: this.itemSize / 4, marginLeft: this.itemSize / 6,
marginRight: this.itemSize / 4, marginRight: this.itemSize / 6,
}} }}
> >
<View style={{ <View style={{
@ -50,8 +50,12 @@ class SmallDashboardItem extends React.Component<Props> {
<Image <Image
source={{uri: props.image}} source={{uri: props.image}}
style={{ style={{
width: "100%", width: "80%",
height: "100%", height: "80%",
marginLeft: "auto",
marginRight: "auto",
marginTop: "auto",
marginBottom: "auto",
}} }}
/> />
{ {

View file

@ -7,7 +7,7 @@ import DashboardItem from "../../components/Home/EventDashboardItem";
import WebSectionList from "../../components/Screens/WebSectionList"; import WebSectionList from "../../components/Screens/WebSectionList";
import {withTheme} from 'react-native-paper'; import {withTheme} from 'react-native-paper';
import FeedItem from "../../components/Home/FeedItem"; import FeedItem from "../../components/Home/FeedItem";
import SquareDashboardItem from "../../components/Home/SmallDashboardItem"; import SmallDashboardItem from "../../components/Home/SmallDashboardItem";
import PreviewEventDashboardItem from "../../components/Home/PreviewEventDashboardItem"; import PreviewEventDashboardItem from "../../components/Home/PreviewEventDashboardItem";
import {stringToDate} from "../../utils/Planning"; import {stringToDate} from "../../utils/Planning";
import ActionsDashBoardItem from "../../components/Home/ActionsDashboardItem"; import ActionsDashBoardItem from "../../components/Home/ActionsDashboardItem";
@ -434,7 +434,7 @@ class HomeScreen extends React.Component<Props, State> {
*/ */
dashboardRowRenderItem = ({item}: { item: DashboardItem }) => { dashboardRowRenderItem = ({item}: { item: DashboardItem }) => {
return ( return (
<SquareDashboardItem <SmallDashboardItem
image={item.image} image={item.image}
onPress={item.onPress} onPress={item.onPress}
badgeCount={this.currentDashboard != null && item.badgeFunction != null badgeCount={this.currentDashboard != null && item.badgeFunction != null
@ -460,7 +460,8 @@ class HomeScreen extends React.Component<Props, State> {
contentContainerStyle={{ contentContainerStyle={{
marginLeft: 'auto', marginLeft: 'auto',
marginRight: 'auto', marginRight: 'auto',
marginTop: 5, marginTop: 10,
marginBottom: 10,
}} }}
/>); />);
} }