Skip to content

Commit

Permalink
Added text modification.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcanosantana committed Nov 26, 2023
1 parent c985d42 commit a861cb8
Showing 1 changed file with 91 additions and 18 deletions.
109 changes: 91 additions & 18 deletions Pages/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,119 @@


<style>
#uri-text-area {
.non-resizable-text-area {
resize: none;
}
</style>


<div class="container py-4 jumbotron-a">
<div class="container">

<div class="row">

<div class="container">
<div class="row">
<!-- Affiliate description and Link -->
<div class="col-12 col-xl-6">
<div class="container py-4 jumbotron-a">

<div class="col-12 col-md-6">
<h3 class="fw-bold"> Afiliación </h3>
<p>
Personaliza tu página de afiliado, compártela con los clientes a través del siguiente enlace.
</p>
</div>
<div class="container">
<div class="row">

<div class="col-12 col-md-6">
<div class="col-12 col-md-4">
<h3 class="fw-bold">Compartir</h3>
<p>
Compárte tu página de afiliado con los clientes a través del siguiente enlace.
</p>
</div>

<form class="user-form">
<div class="col-12 col-md-8">

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Link de afiliado</label>
<textarea id="uri-text-area" value="@GetAbsoluteUri()" class="form-control" rows="3" readonly></textarea>
</div>
<form class="user-form">

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Link de afiliado</label>
<textarea value="@GetAbsoluteUri()" class="form-control non-resizable-text-area" rows="3" readonly></textarea>
</div>

</form>
</form>

</div>

</div>
</div>

</div>
</div>

<!-- Affiliate page settings -->
<div class="col-12 col-xl-6">
<div class="container py-4 jumbotron-a">

<div class="container">
<div class="row">

<div class="col-12 col-md-4">
<h3 class="fw-bold"> Textos </h3>
<p>
Añade un título corto y una descripción sobre tu invitación al cliente.
</p>
</div>

<div class="col-12 col-md-8">

<form class="user-form">

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Título</label>
<input @bind-value="customTitle" @bind-value:event="oninput" class="form-control">
</div>

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Descripción</label>
<textarea @bind-value="customDescription" @bind-value:event="oninput" rows="10" class="form-control non-resizable-text-area"></textarea>
</div>

</form>

</div>

</div>
</div>

</div>
</div>
</div>

</div>
</div>







@code {

private AffiliateStyle? customStyle;
private String customTitle = "";
private String customDescription = "";

protected override async Task OnInitializedAsync()

Check warning on line 106 in Pages/Dashboard.razor

View workflow job for this annotation

GitHub Actions / deploy-to-github-pages

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
SetCustomStyle();
}

private void SetCustomStyle()
{
customStyle = UserService.GetAffiliateStyle(UserService.GetLoggedUser().GetId());

Check warning on line 113 in Pages/Dashboard.razor

View workflow job for this annotation

GitHub Actions / deploy-to-github-pages

Dereference of a possibly null reference.

//Recover data
if (customStyle != null)
{
customTitle = customStyle.GetTitle();
customDescription = customStyle.GetSummary();
}
}

private String GetAbsoluteUri()
{
//Detect if it's from localhost or online, change the uri depending of that
Expand Down

0 comments on commit a861cb8

Please sign in to comment.