Skip to content

Commit e7aa483

Browse files
authored
Merge pull request #1474 from StoDevX/landscape
Fix Landscape stuffs
2 parents 5782a32 + a762251 commit e7aa483

File tree

10 files changed

+312
-222
lines changed

10 files changed

+312
-222
lines changed

package-lock.json

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"react-native-restart": "0.0.3",
8181
"react-native-safari-view": "2.0.0",
8282
"react-native-search-bar": "3.0.0",
83-
"react-native-sortable-list": "github:hawkrives/react-native-sortable-list#a46c78161e0a1a8d3a45f2fef69d98af3e911b6d",
83+
"react-native-sortable-list": "github:hawkrives/react-native-sortable-list#7b72cc8e16cc71751836b49b3ea4bbc9e8e9cb99",
8484
"react-native-tableview-simple": "0.16.11",
8585
"react-native-vector-icons": "4.3.0",
8686
"react-native-video": "2.0.0",

source/lib/partition-by-index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @flow
2+
3+
export function partitionByIndex<T>(arr: T[]): [T[], T[]] {
4+
return arr.reduce(
5+
(acc, val, idx) => {
6+
return idx % 2 === 0
7+
? [acc[0].concat(val), acc[1]]
8+
: [acc[0], acc[1].concat(val)]
9+
},
10+
[[], []],
11+
)
12+
}

source/storybook/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {HomeView, EditHomeView} from '../views/home'
3434

3535
import StreamingView from '../views/streaming'
3636
import KSTOView from '../views/streaming/radio'
37-
import WebcamsView from '../views/streaming/webcams'
37+
import {WebcamsView} from '../views/streaming/webcams'
3838

3939
import {MenusView} from '../views/menus'
4040

source/views/home/button.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
// @flow
22

33
import React from 'react'
4-
import {Text, StyleSheet, Platform, Dimensions} from 'react-native'
4+
import {Text, StyleSheet, Platform} from 'react-native'
55
import Icon from 'react-native-vector-icons/Entypo'
66
import type {ViewType} from '../views'
77
import {Touchable} from '../components/touchable'
88
import * as c from '../components/colors'
99

10-
const Viewport = Dimensions.get('window')
11-
1210
export function HomeScreenButton({
1311
view,
1412
onPress,
1513
}: {
1614
view: ViewType,
1715
onPress: () => any,
1816
}) {
17+
const style = {backgroundColor: view.tint}
18+
1919
return (
2020
<Touchable
2121
highlight={false}
2222
onPress={onPress}
23-
style={[styles.rectangle, {backgroundColor: view.tint}]}
23+
style={[styles.rectangle, style]}
2424
>
2525
<Icon name={view.icon} size={32} style={styles.rectangleButtonIcon} />
2626
<Text style={styles.rectangleButtonText}>
@@ -33,18 +33,20 @@ export function HomeScreenButton({
3333
export const CELL_MARGIN = 10
3434
const cellVerticalPadding = 8
3535
const cellHorizontalPadding = 4
36-
const cellWidth = Viewport.width / 2 - CELL_MARGIN * 1.5
3736

3837
const styles = StyleSheet.create({
3938
// Main buttons for actions on home screen
4039
rectangle: {
41-
width: cellWidth,
40+
flex: 1,
41+
4242
alignItems: 'center',
4343
justifyContent: 'center',
44+
4445
paddingTop: cellVerticalPadding,
4546
paddingBottom: cellVerticalPadding / 2,
4647
paddingHorizontal: cellHorizontalPadding,
4748
borderRadius: Platform.OS === 'ios' ? 6 : 3,
49+
4850
elevation: 2,
4951

5052
marginTop: CELL_MARGIN / 2,
@@ -59,9 +61,9 @@ const styles = StyleSheet.create({
5961
},
6062
rectangleButtonText: {
6163
color: c.white,
62-
marginTop: cellVerticalPadding / 2,
64+
// marginTop: cellVerticalPadding / 2,
6365
fontFamily: Platform.OS === 'ios' ? 'System' : 'sans-serif-condensed',
64-
textAlign: 'center',
66+
// textAlign: 'center',
6567
fontSize: 14,
6668
},
6769
})

0 commit comments

Comments
 (0)