blob: 0bbec6fe79f732bfad29b9174448656c5ec1461e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// @flow
import * as RX from 'reactxp';
type ExtractViewReturnType = <V>(V) => Object;
type ExtractTextReturnType = <V>(V) => Object;
export function createViewStyles<T: { [string]: Object }>(
styles: T,
): $ObjMap<T, ExtractViewReturnType> {
const viewStyles = {};
for (const style of Object.keys(styles)) {
viewStyles[style] = RX.Styles.createViewStyle(styles[style]);
}
return viewStyles;
}
export function createTextStyles<T: { [string]: Object }>(
styles: T,
): $ObjMap<T, ExtractTextReturnType> {
const textStyles = {};
for (const style of Object.keys(styles)) {
textStyles[style] = RX.Styles.createTextStyle(styles[style]);
}
return textStyles;
}
|