Skip to content

Commit 6f62ec8

Browse files
committed
Use Feliz
1 parent 36356d4 commit 6f62ec8

File tree

2 files changed

+35
-28
lines changed

2 files changed

+35
-28
lines changed

src/Client/Client.fsproj

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3-
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<DefineConstants>FABLE_COMPILER</DefineConstants>
6-
</PropertyGroup>
7-
<ItemGroup>
8-
<None Include="index.html" />
9-
<Compile Include="Index.fs" />
10-
<Compile Include="App.fs" />
11-
</ItemGroup>
12-
<ItemGroup>
13-
<ProjectReference Include="..\Shared\Shared.fsproj" />
14-
</ItemGroup>
15-
<ItemGroup>
16-
<PackageReference Include="Fable.Core" Version="3.1.5" />
17-
<PackageReference Include="Fable.Elmish" Version="3.0.6" />
18-
<PackageReference Include="Fable.Elmish.React" Version="3.0.1" />
19-
<PackageReference Include="Fable.Elmish.Debugger" Version="3.2.0" />
20-
<PackageReference Include="Fable.Elmish.Hmr" Version="4.0.1" />
21-
<PackageReference Include="Fable.React" Version="5.3.6" />
22-
<PackageReference Include="Thoth.Fetch" Version="2.0.0" />
23-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<DefineConstants>FABLE_COMPILER</DefineConstants>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<None Include="index.html" />
9+
<Compile Include="Index.fs" />
10+
<Compile Include="App.fs" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\Shared\Shared.fsproj" />
14+
</ItemGroup>
15+
<ItemGroup>
16+
<PackageReference Include="Fable.Core" Version="3.1.5" />
17+
<PackageReference Include="Fable.Elmish" Version="3.0.6" />
18+
<PackageReference Include="Fable.Elmish.React" Version="3.0.1" />
19+
<PackageReference Include="Fable.Elmish.Debugger" Version="3.2.0" />
20+
<PackageReference Include="Fable.Elmish.Hmr" Version="4.0.1" />
21+
<PackageReference Include="Fable.React" Version="7.2.0" />
22+
<PackageReference Include="Feliz" Version="1.32.0" />
23+
<PackageReference Include="Thoth.Fetch" Version="2.0.0" />
24+
</ItemGroup>
2425
</Project>

src/Client/Index.fs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ let update msg model =
2323
| GotHello hello ->
2424
{ model with Hello = hello }, Cmd.none
2525

26-
open Fable.React
27-
open Fable.React.Props
26+
open Feliz
2827

2928
let view model dispatch =
30-
div [ Style [ TextAlign TextAlignOptions.Center; Padding 40 ] ] [
31-
div [] [
32-
img [ Src "favicon.png" ]
33-
h1 [] [ str "safe_minimal" ]
34-
h2 [] [ str model.Hello ]
29+
Html.div [
30+
prop.style [
31+
style.fontFamily "sans-serif"
32+
style.textAlign.center
33+
style.padding 40
34+
]
35+
prop.children [
36+
Html.div [
37+
Html.img [ prop.src "favicon.png" ]
38+
Html.h1 "safe_minimal"
39+
Html.h2 model.Hello
40+
]
3541
]
3642
]

0 commit comments

Comments
 (0)