diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-10 15:58:05 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-07-16 16:44:05 +0200 |
| commit | 15d1af70f68c81767cd6e0096fbc6d23ac2a768b (patch) | |
| tree | b5ea8e3de360d7776516799820e1491d884a69f5 /app/lib | |
| parent | fa8cf2513f2ab2ffca71fb32c02e4d1452313076 (diff) | |
| download | mullvadvpn-15d1af70f68c81767cd6e0096fbc6d23ac2a768b.tar.xz mullvadvpn-15d1af70f68c81767cd6e0096fbc6d23ac2a768b.zip | |
Fix the use of ObjMap<T, F> in styles.js
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/styles.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/lib/styles.js b/app/lib/styles.js index 4cde4fdfce..0bbec6fe79 100644 --- a/app/lib/styles.js +++ b/app/lib/styles.js @@ -1,25 +1,26 @@ // @flow -import { Styles } from 'reactxp'; +import * as RX from 'reactxp'; -type ExtractReturnType = (*) => Object; +type ExtractViewReturnType = <V>(V) => Object; +type ExtractTextReturnType = <V>(V) => Object; export function createViewStyles<T: { [string]: Object }>( styles: T, -): $ObjMap<T, ExtractReturnType> { +): $ObjMap<T, ExtractViewReturnType> { const viewStyles = {}; for (const style of Object.keys(styles)) { - viewStyles[style] = Styles.createViewStyle(styles[style]); + viewStyles[style] = RX.Styles.createViewStyle(styles[style]); } return viewStyles; } export function createTextStyles<T: { [string]: Object }>( styles: T, -): $ObjMap<T, ExtractReturnType> { +): $ObjMap<T, ExtractTextReturnType> { const textStyles = {}; for (const style of Object.keys(styles)) { - textStyles[style] = Styles.createTextStyle(styles[style]); + textStyles[style] = RX.Styles.createTextStyle(styles[style]); } return textStyles; } |
