Login: allow edit of title & button text

This commit is contained in:
Michael Shanks 2020-07-06 11:30:36 +01:00
parent 3fc9fbfd39
commit 877a9b1033
4 changed files with 21 additions and 7 deletions

View File

@ -303,6 +303,16 @@ export default {
key: "logo", key: "logo",
control: Input, control: Input,
}, },
{
label: "Title",
key: "title",
control: Input,
},
{
label: "Button Text",
key: "buttonText",
control: Input,
},
], ],
}, },
}, },

View File

@ -28,7 +28,8 @@
"_instanceName": "Login", "_instanceName": "Login",
"inputClass": "", "inputClass": "",
"_children": [], "_children": [],
"name": "{{ name }}", "title": "Login to {{ name }}",
"buttonText": "Login",
"logo": "" "logo": ""
} }
], ],

View File

@ -66,7 +66,7 @@
"props": { "props": {
"logo": "asset", "logo": "asset",
"loginRedirect": "string", "loginRedirect": "string",
"name": "string", "title": "string",
"usernameLabel": { "usernameLabel": {
"type": "string", "type": "string",
"default": "Username" "default": "Username"
@ -80,7 +80,8 @@
"default": "Login" "default": "Login"
}, },
"buttonClass": "string", "buttonClass": "string",
"inputClass": "string" "inputClass": "string",
"buttonText": "string"
}, },
"tags": [ "tags": [
"login", "login",

View File

@ -1,9 +1,9 @@
<script> <script>
import Button from "./Button.svelte" import Button from "./Button.svelte"
export let loginButtonLabel = "Login" export let buttonText = "Login"
export let logo = "" export let logo = ""
export let name = "" export let title = ""
export let buttonClass = "" export let buttonClass = ""
export let inputClass = "" export let inputClass = ""
@ -47,7 +47,9 @@
</div> </div>
{/if} {/if}
<h1 class="header-content">Log in to {name}</h1> {#if title}
<h1 class="header-content">{title}</h1>
{/if}
<div class="form-root"> <div class="form-root">
<div class="control"> <div class="control">
@ -69,7 +71,7 @@
<div class="login-button-container"> <div class="login-button-container">
<button disabled={loading} on:click={login} class={_buttonClass}> <button disabled={loading} on:click={login} class={_buttonClass}>
Log in to {name} {buttonText || "Login"}
</button> </button>
</div> </div>