Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
feat: add name length check at registration
l2ig committed 3 years ago
commit 5845ce97b03b91cbe3a14bb5335f0d21c725aea3
parent 34698071c435807c0982987b421b6fdc54b9033b
1 file changed +11 -1
modified src/base/registrations/Index.svelte
@@ -32,6 +32,11 @@
  .name {
    margin: 1rem;
  }
+
  .input-info {
+
    position: absolute;
+
    font-style: italic;
+
    margin-top: 0.1rem;
+
  }
</style>

<svelte:head>
@@ -51,9 +56,14 @@
          placeholder=""
          root={config.registrar.domain}
        />
+
        {#if label && label.length < 2}
+
          <span class="input-info">Please enter a minimum of 2 characters.</span>
+
        {:else if label && label.length > 128}
+
          <span class="input-info">Please enter a maximum of 128 characters.</span>
+
        {/if}
      </span>

-
      <button disabled={!label} class="primary register regular" on:click={register}>
+
      <button disabled={!label || label.length < 2 || label.length > 128} class="primary register regular" on:click={register}>
        Check
      </button>
    </div>