-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #738 from shoutem/release/5.3.0
Release/5.3.0
- Loading branch information
Showing
13 changed files
with
26,964 additions
and
3,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import { View } from '../components/View'; | ||
|
||
test('View renders correctly', () => { | ||
const tree = renderer.create( | ||
<View style={{ height: 40, width: 40, backgroundColor: 'red' }} />, | ||
).toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('View renders children vertically with vertical styleName', () => { | ||
const tree = renderer.create( | ||
<View styleName="vertical"> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'red' }} /> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'green' }} /> | ||
</View> | ||
); | ||
}); | ||
|
||
test('View centers children horizontally with h-center styleName', () => { | ||
const tree = renderer.create( | ||
<View style={{ width: 100 }} styleName="vertical h-center"> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'red' }} /> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'green' }} /> | ||
</View> | ||
); | ||
}); | ||
|
||
test('View renders children horizontally with horizontal styleName', () => { | ||
const tree = renderer.create( | ||
<View styleName="horizontal"> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'red' }} /> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'green' }} /> | ||
</View> | ||
); | ||
}); | ||
|
||
test('View centers children vertically with v-center styleName', () => { | ||
const tree = renderer.create( | ||
<View style={{ height: 100 }} styleName="horizontal v-center"> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'red' }} /> | ||
<View style={{ height: 40, width: 40, backgroundColor: 'green' }} /> | ||
</View> | ||
); | ||
}); | ||
|
||
test('View fills parent with fill-parent styleName', () => { | ||
const tree = renderer.create( | ||
<View style={{ height: 40, width: 40 }}> | ||
<View style={{ backgroundColor: 'red' }} styleName="fill-parent" /> | ||
</View> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`View renders correctly 1`] = ` | ||
<View | ||
animationOptions={Object {}} | ||
onLayout={[Function]} | ||
style={ | ||
Object { | ||
"backgroundColor": "red", | ||
"height": 40, | ||
"width": 40, | ||
} | ||
} | ||
/> | ||
`; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
const IPHONE_X_HOME_INDICATOR_PADDING = 34; | ||
const IPHONE_X_LONG_SIDE = 812; | ||
const IPHONE_X_NOTCH_PADDING = 30; | ||
|
||
const IPHONE_XR_LONG_SIDE = 896; | ||
const IPHONE_XR_NOTCH_PADDING = 34; | ||
|
||
const IPHONE_12_LONG_SIDE = 844; | ||
const IPHONE_12_MAX_LONG_SIDE = 926; | ||
|
||
const NAVIGATION_HEADER_HEIGHT = 64; | ||
|
||
module.exports = { | ||
import { Platform, StatusBar } from 'react-native'; | ||
import { | ||
IPHONE_12_LONG_SIDE, | ||
IPHONE_12_MAX_LONG_SIDE, | ||
IPHONE_X_HOME_INDICATOR_PADDING, | ||
IPHONE_X_LONG_SIDE, | ||
IPHONE_X_NOTCH_PADDING, | ||
IPHONE_XR_LONG_SIDE, | ||
IPHONE_XR_NOTCH_PADDING, | ||
NAVIGATION_BAR_HEIGHT, | ||
NAVIGATION_HEADER_HEIGHT, | ||
} from './helpers'; | ||
|
||
const STATUS_BAR_OFFSET = | ||
Platform.OS === 'android' ? -StatusBar.currentHeight : 0; | ||
|
||
// TODO: Deprecate and remove exports from here | ||
// Currently leaving for backwards compatibility | ||
export { | ||
IPHONE_12_LONG_SIDE, | ||
IPHONE_12_MAX_LONG_SIDE, | ||
IPHONE_X_HOME_INDICATOR_PADDING, | ||
IPHONE_X_LONG_SIDE, | ||
IPHONE_X_NOTCH_PADDING, | ||
IPHONE_XR_LONG_SIDE, | ||
IPHONE_XR_NOTCH_PADDING, | ||
NAVIGATION_BAR_HEIGHT, | ||
NAVIGATION_HEADER_HEIGHT, | ||
STATUS_BAR_OFFSET, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
import { Device } from './device-selector'; | ||
import Keyboard from './keyboard'; | ||
|
||
export { Device, Keyboard }; | ||
export { | ||
Device, | ||
IPHONE_12_LONG_SIDE, | ||
IPHONE_12_MAX_LONG_SIDE, | ||
IPHONE_X_HOME_INDICATOR_PADDING, | ||
IPHONE_X_LONG_SIDE, | ||
IPHONE_X_NOTCH_PADDING, | ||
IPHONE_XR_LONG_SIDE, | ||
IPHONE_XR_NOTCH_PADDING, | ||
NAVIGATION_BAR_HEIGHT, | ||
NAVIGATION_HEADER_HEIGHT, | ||
} from './device-selector'; | ||
export { calculateKeyboardOffset, default as Keyboard } from './keyboard'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.