Added a setting to allow the title's text alignment to be changed (#13235)
* Added setting to allow title text alignment to be set and changed * Switched out for icons instead of a select as per feedback. * Edited right icon to display the correct icon. * Updated to use the paragrah alignment component icons. * Added button list component * Reworked template to use BarButtonList over ActionButton component * Updated selectedArray name to alignmentOptions provides better meaning
This commit is contained in:
parent
5d5c0ebebd
commit
35e1114fac
|
@ -24,6 +24,13 @@
|
||||||
navigationStore,
|
navigationStore,
|
||||||
} from "stores/builder"
|
} from "stores/builder"
|
||||||
import { DefaultAppTheme } from "constants"
|
import { DefaultAppTheme } from "constants"
|
||||||
|
import BarButtonList from "/src/components/design/settings/controls/BarButtonList.svelte"
|
||||||
|
|
||||||
|
$: alignmentOptions = [
|
||||||
|
{ value: "Left", barIcon: "TextAlignLeft" },
|
||||||
|
{ value: "Center", barIcon: "TextAlignCenter" },
|
||||||
|
{ value: "Right", barIcon: "TextAlignRight" },
|
||||||
|
]
|
||||||
|
|
||||||
$: screenRouteOptions = $screenStore.screens
|
$: screenRouteOptions = $screenStore.screens
|
||||||
.map(screen => screen.routing?.route)
|
.map(screen => screen.routing?.route)
|
||||||
|
@ -46,6 +53,10 @@
|
||||||
notifications.error("Error updating navigation settings")
|
notifications.error("Error updating navigation settings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateTextAlign = textAlignValue => {
|
||||||
|
navigationStore.syncAppNavigation({ textAlign: textAlignValue })
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Panel
|
<Panel
|
||||||
|
@ -133,6 +144,15 @@
|
||||||
on:change={e => update("title", e.detail)}
|
on:change={e => update("title", e.detail)}
|
||||||
updateOnChange={false}
|
updateOnChange={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="label">
|
||||||
|
<Label size="M">Text align</Label>
|
||||||
|
</div>
|
||||||
|
<BarButtonList
|
||||||
|
options={alignmentOptions}
|
||||||
|
value={$navigationStore.textAlign}
|
||||||
|
onChange={updateTextAlign}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<Label>Background</Label>
|
<Label>Background</Label>
|
||||||
|
|
|
@ -11,6 +11,7 @@ export const INITIAL_NAVIGATION_STATE = {
|
||||||
hideLogo: null,
|
hideLogo: null,
|
||||||
logoUrl: null,
|
logoUrl: null,
|
||||||
hideTitle: null,
|
hideTitle: null,
|
||||||
|
textAlign: "Left",
|
||||||
navBackground: null,
|
navBackground: null,
|
||||||
navWidth: null,
|
navWidth: null,
|
||||||
navTextColor: null,
|
navTextColor: null,
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
export let pageWidth
|
export let pageWidth
|
||||||
export let logoLinkUrl
|
export let logoLinkUrl
|
||||||
export let openLogoLinkInNewTab
|
export let openLogoLinkInNewTab
|
||||||
|
export let textAlign
|
||||||
|
|
||||||
export let embedded = false
|
export let embedded = false
|
||||||
|
|
||||||
|
@ -226,7 +227,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{#if !hideTitle && title}
|
{#if !hideTitle && title}
|
||||||
<Heading size="S">{title}</Heading>
|
<Heading size="S" {textAlign}>{title}</Heading>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if !embedded}
|
{#if !embedded}
|
||||||
|
|
Loading…
Reference in New Issue