Skip to content

Commit

Permalink
Update code to fable 2
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Feb 20, 2019
1 parent f01e6b4 commit 6b94129
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/Nightwatch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Program.mkProgram App.init App.update App.view
#if RELEASE
#else
|> Program.withConsoleTrace
|> Program.withHMR
#endif
|> Program.withReactNative "nightwatch"
|> Program.run
8 changes: 4 additions & 4 deletions src/Scenes/CheckLocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let view (model:Model) (dispatch: Msg -> unit) =
match model.PictureUri with
| Some uri ->
image
[ Source [ Uri uri; IsStatic true]
[ Source (localImage uri)
ImageProperties.Style [
ImageStyle.BorderColor "#000000"
FlexStyle.Flex 3.
Expand All @@ -104,11 +104,11 @@ let view (model:Model) (dispatch: Msg -> unit) =

view [ Styles.sceneBackground ]
[ text [ Styles.defaultText ] model.LocationCheckRequest.Name
textInput [
textInputWithChild [
TextInput.TextInputProperties.AutoCorrect false
TextInput.TextInputProperties.Style [
FlexStyle.MarginTop 2.
FlexStyle.MarginBottom 2.
FlexStyle.MarginTop (unbox 2.)
FlexStyle.MarginBottom (unbox 2.)
TextStyle.Color Styles.textColor
ViewStyle.BackgroundColor Styles.inputBackgroundColor
]
Expand Down
8 changes: 4 additions & 4 deletions src/Scenes/LocationList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ let view (model:Model) (dispatch: Msg -> unit) =
image
[ Source uri
ImageProperties.Style [
FlexStyle.Width 24.
FlexStyle.Height 24.
FlexStyle.Width (unbox 24.)
FlexStyle.Height (unbox 24.)
FlexStyle.AlignSelf Alignment.Center
]
])
Expand All @@ -86,8 +86,8 @@ let view (model:Model) (dispatch: Msg -> unit) =

flatList model.Requests [
InitialNumToRender 20
KeyExtractor (Func<_,_,_>(fun (i,_) _ -> i.ToString()))
RenderItem (Func<_,_>(fun v -> renderItem v.item))
KeyExtractor (fun (i,_) _ -> i.ToString())
RenderItem (fun v -> renderItem v.item)
]
Styles.button "OK" (fun () -> dispatch GoBack)
]
6 changes: 3 additions & 3 deletions src/Styles.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let renderText fontSize =
TextProperties.Style [
TextStyle.Color textColor
TextStyle.TextAlign TextAlignment.Center
FlexStyle.Margin 3.
FlexStyle.Margin (unbox 3.)
TextStyle.FontSize fontSize
]

Expand All @@ -47,7 +47,7 @@ let whitespace<'a> = text [ smallText ] ""
let sceneBackground<'a> =
ViewProperties.Style [
FlexStyle.AlignSelf Alignment.Stretch
FlexStyle.Padding 20.
FlexStyle.Padding (unbox 20.)
ViewStyle.ShadowColor shadowColor
ViewStyle.ShadowOpacity 0.8
ViewStyle.ShadowRadius 3.
Expand All @@ -59,7 +59,7 @@ let sceneBackground<'a> =
let viewPagerBackground<'a> =
ViewPagerAndroidProperties.Style [
FlexStyle.AlignSelf Alignment.Stretch
FlexStyle.Padding 20.
FlexStyle.Padding (unbox 20.)
ViewStyle.ShadowColor shadowColor
ViewStyle.ShadowOpacity 0.8
ViewStyle.ShadowRadius 3.
Expand Down

0 comments on commit 6b94129

Please sign in to comment.