Browse Source

Improved dashboard item size

Arnaud Vergnet 3 years ago
parent
commit
8864e686bd
2 changed files with 12 additions and 7 deletions
  1. 8
    4
      src/components/Home/SmallDashboardItem.js
  2. 4
    3
      src/screens/Home/HomeScreen.js

+ 8
- 4
src/components/Home/SmallDashboardItem.js View File

@@ -39,8 +39,8 @@ class SmallDashboardItem extends React.Component<Props> {
39 39
                     onPress={this.props.onPress}
40 40
                     borderless={true}
41 41
                     style={{
42
-                        marginLeft: this.itemSize / 4,
43
-                        marginRight: this.itemSize / 4,
42
+                        marginLeft: this.itemSize / 6,
43
+                        marginRight: this.itemSize / 6,
44 44
                     }}
45 45
                 >
46 46
                     <View style={{
@@ -50,8 +50,12 @@ class SmallDashboardItem extends React.Component<Props> {
50 50
                         <Image
51 51
                             source={{uri: props.image}}
52 52
                             style={{
53
-                                width: "100%",
54
-                                height: "100%",
53
+                                width: "80%",
54
+                                height: "80%",
55
+                                marginLeft: "auto",
56
+                                marginRight: "auto",
57
+                                marginTop: "auto",
58
+                                marginBottom: "auto",
55 59
                             }}
56 60
                         />
57 61
                         {

+ 4
- 3
src/screens/Home/HomeScreen.js View File

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

Loading…
Cancel
Save