Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyaz committed Oct 1, 2024
1 parent 7584ccf commit 683d354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ReactWithDotNet.WebSite/Components/MainPageContentSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ protected override Element render()

return new Playground
{
Height = 300,

TypeOfTargetComponent = typeof(HomePageDemoComponent),

Files = files.Select(fi => (Path.GetFileName(fi), File.ReadAllText(fi))).ToList()
Expand Down
6 changes: 4 additions & 2 deletions ReactWithDotNet.WebSite/Components/Playground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ class Playground : Component<PlaygroundState>

public Type TypeOfTargetComponent { get; init; }

public double? Height { get; init; }

protected override Task constructor()
{
state = new PlaygroundState
state = new()
{
Files = Files ?? new List<(string fileName, string fileContent)>(),
SelectedFileName = SelectedFileName,
Expand All @@ -43,7 +45,7 @@ protected override Element render()

var width = Width(100 * percent) + MD(Width(50 * percent));

return new FlexColumn(SizeFull, BoxShadow("rgb(0 0 0 / 34%) 0px 2px 5px 0px"), BorderRadius(3), CursorDefault)
return new FlexColumn(SizeFull, Height is null ? null:Height(Height), BoxShadow("rgb(0 0 0 / 34%) 0px 2px 5px 0px"), BorderRadius(3), CursorDefault)
{
Part_AppBar,

Expand Down

0 comments on commit 683d354

Please sign in to comment.