Skip to content

Commit e3c20ca

Browse files
committed
Add logo option to appMetadata
1 parent a1d5c86 commit e3c20ca

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

packages/common/src/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ export interface AppMetadata {
124124
/* App name */
125125
name: string
126126

127-
/* SVG icon string, with height set to 100% */
127+
/* SVG icon string or image url, with height set to 100% */
128128
icon: string
129129

130+
/* SVG logo (icon and text) string or image url, with width set to 100% */
131+
logo?: string
132+
130133
/* Description of app*/
131134
description?: string
132135

packages/core/src/validation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const appMetadata = Joi.object({
6868
name: Joi.string().required(),
6969
description: Joi.string().required(),
7070
icon: Joi.string().required(),
71+
logo: Joi.string(),
7172
gettingStartedGuide: Joi.string(),
7273
email: Joi.string(),
7374
appUrl: Joi.string(),

packages/core/src/views/connect/Sidebar.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
export let step: keyof i18n['connect']
1010
1111
const { appMetadata } = internalState$.getValue()
12-
const { icon, name = 'This app' } = appMetadata || {}
12+
const { icon, logo, name = 'This app' } = appMetadata || {}
1313
1414
const defaultContent = en.connect[step].sidebar
1515
const { subheading, paragraph } = defaultContent
@@ -110,11 +110,11 @@
110110
<div class="sidebar">
111111
<div class="inner-container">
112112
<div class="icon-container">
113-
{#if icon}
114-
{#if isUrl(icon)}
115-
<img height="100%" src={icon} alt="logo" />
113+
{#if logo || icon}
114+
{#if isUrl(logo || icon)}
115+
<img height="100%" src={logo || icon} alt="logo" />
116116
{:else}
117-
{@html icon}
117+
{@html logo || icon}
118118
{/if}
119119
{:else}
120120
{@html blocknative}

0 commit comments

Comments
 (0)