Skip to content

Commit

Permalink
fix: small isue with create race crush
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystianKempski committed Nov 1, 2024
1 parent 7b94836 commit bc2c91c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DagoniteEmpire/Pages/CharacterPages/CharacterUpsert.razor
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

<div class="traits p-2">
<MudPaper Class="p-2 m-0 w-100 h-100">
<h3 class="p-3 m-0 text-center">TRAITS</h3>
<h3 class="p-3 m-0 text-center">TRAITS</h3>
<div class="trait-container">
<TraitsComponent OnTraitsChange="TraitsChange" @bind-Traits="@AllParams.TraitsCharacter" TraitType="@SD.TraitType_Character"></TraitsComponent>
</div>
Expand Down
8 changes: 5 additions & 3 deletions DagoniteEmpire/Pages/Components/TraitsComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@
</table>
</div>
<div class="row">
@if (TraitType == SD.TraitType_Character && (UserInfo?.IsAdminOrMG == true || AllParams.Character.IsApproved == false))

@if (TraitType == SD.TraitType_Character && (UserInfo?.IsAdminOrMG == true || AllParams?.Character.IsApproved == false))
{
<label class="balance">Traits balance: @AllParams.Character.TraitBalance </label>
<label class="balance">Traits balance: @AllParams?.Character.TraitBalance </label>
}

@if (IsInfoMode == false && ( UserInfo?.IsAdminOrMG == true || AllParams.Character.IsApproved == false || TraitType != SD.TraitType_Character))
@if (IsInfoMode == false && ( UserInfo?.IsAdminOrMG == true || AllParams?.Character.IsApproved == false || TraitType != SD.TraitType_Character))
{
<div class="buttons-row">
<button @onclick="@(()=>AddCustomTrait())" class="add-trait">Add @TraitName</button>
Expand All @@ -80,6 +81,7 @@
<button @onclick="@(()=>AddExistingTrait())" class="add-trait">Existing @TraitName </button>
</div>
}

</div>
</div>

Expand Down
36 changes: 17 additions & 19 deletions DagoniteEmpire/Pages/Dialogs/CreateRaceDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
</div>
<div class="d-flex flex-column flex-grow-1">
<label class="fw-bold p-1">Race description</label>
<MudTextField @bind-Value="@NewRace.Description" Lines="8">

</MudTextField>
@* <SfRichTextEditor Height="350px" @ref="DescrEdit" @bind-Value="@NewRace.Description" ShowTooltip="true">
@* <MudTextField @bind-Value="@NewRace.Description" Lines="8"></MudTextField> *@
<SfRichTextEditor Height="350px" @ref="DescrEdit" @bind-Value="@NewRace.Description" ShowTooltip="true">
<RichTextEditorToolbarSettings Items="@Tools" Type="ToolbarType.MultiRow" />
</SfRichTextEditor> *@
</SfRichTextEditor>
</div>


Expand Down Expand Up @@ -71,20 +69,20 @@

private SfRichTextEditor DescrEdit = new SfRichTextEditor();
private string TraitType { get; set; } = @SD.TraitType_Race;
// private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
// {
// new ToolbarItemModel() { Command = ToolbarCommand.Bold },
// new ToolbarItemModel() { Command = ToolbarCommand.Italic },
// new ToolbarItemModel() { Command = ToolbarCommand.Underline },
// new ToolbarItemModel() { Command = ToolbarCommand.StrikeThrough },
// new ToolbarItemModel() { Command = ToolbarCommand.FontName },
// new ToolbarItemModel() { Command = ToolbarCommand.FontSize },
// new ToolbarItemModel() { Command = ToolbarCommand.Separator },
// new ToolbarItemModel() { Command = ToolbarCommand.Formats },
// new ToolbarItemModel() { Command = ToolbarCommand.Alignments },
// new ToolbarItemModel() { Command = ToolbarCommand.CreateLink },
// new ToolbarItemModel() { Command = ToolbarCommand.FullScreen },
// };
private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.Bold },
new ToolbarItemModel() { Command = ToolbarCommand.Italic },
new ToolbarItemModel() { Command = ToolbarCommand.Underline },
new ToolbarItemModel() { Command = ToolbarCommand.StrikeThrough },
new ToolbarItemModel() { Command = ToolbarCommand.FontName },
new ToolbarItemModel() { Command = ToolbarCommand.FontSize },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.Formats },
new ToolbarItemModel() { Command = ToolbarCommand.Alignments },
new ToolbarItemModel() { Command = ToolbarCommand.CreateLink },
new ToolbarItemModel() { Command = ToolbarCommand.FullScreen },
};

private void OnSaveRaceBtnClick()
{
Expand Down

0 comments on commit bc2c91c

Please sign in to comment.