Skip to content

Commit

Permalink
Fix some bug related to init and themes
Browse files Browse the repository at this point in the history
  • Loading branch information
saltict committed Aug 10, 2024
1 parent 4b0ad85 commit 82a906d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ function init(options: InitOptions): OnboardAPI {
connect,
containerElements,
transactionPreview,
theme,
theme = 'default',
disableFontDownload,
unstoppableResolution,
chainsPolkadot,
wcConfigOption
} = options



if (containerElements) updateConfiguration({ containerElements })

const { device, svelteInstance } = configuration
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import type { BuiltInThemes, Theme, ThemingMap } from './types'

export const themes = {
default: {
'--w3o-background-color': 'unset',
'--w3o-foreground-color': 'unset',
'--w3o-text-color': 'unset',
'--w3o-border-color': 'unset',
'--w3o-action-color': 'unset',
'--w3o-border-radius': 'unset',
'--w3o-background-color': '#0C0C0C',
'--w3o-foreground-color': '#0C0C0C',
'--w3o-text-color': 'rgba(255, 255, 255, 0.8)',
'--w3o-border-color': '#212121',
'--w3o-action-color': '#252525',
'--w3o-border-radius': '16px',
'--w3o-font-family': 'inherit',
'--w3o-background-color-item': 'inherit'
'--w3o-background-color-item': '#1A1A1A'
},
light: {
'--w3o-background-color': '#ffffff',
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export type ThemingMap = {
'--w3o-text-color'?: string
'--w3o-border-color'?: string
'--w3o-action-color'?: string
'--w3o-border-radius'?: string
'--w3o-border-radius'?: string,
'--w3o-background-color-item'?: string,
}
export interface ConnectOptions {
autoSelect?: { label: string; disableModals: boolean, type : WalletState['type'] }
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ const themeMap = Joi.object({
'--w3o-text-color': Joi.string(),
'--w3o-border-color': Joi.string(),
'--w3o-action-color': Joi.string(),
'--w3o-border-radius': Joi.string()
'--w3o-border-radius': Joi.string(),
'--w3o-background-color-item': Joi.string()
})

const presetTheme = Joi.string().valid('default', 'dark', 'light', 'system')
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/views/connect/ConnectingWallet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
if(isOpen && modal && uri !== ''){
try{
await modal.openModal({ uri });
}catch (e) {
} catch (e) {
console.log(e)
}
}else{
modal.closeModal();
} else {
modal?.closeModal();
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/views/connect/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
if(isOpen && modal && uri !== ''){
modal.openModal({ uri })
}else{
modal.closeModal();
modal?.closeModal();
}
})
Expand Down

0 comments on commit 82a906d

Please sign in to comment.