Skip to content

Commit

Permalink
fix: fix wrong test button color on custom domain (snapshot-labs#4561)
Browse files Browse the repository at this point in the history
* fix: button primary color to black and white

* fix: prevent invalid transactions being submitted with osnap plugin (snapshot-labs#4552)

* disable publish if osnap tx invalid

* set state upstream even if invalid, better input logic

* don't allow empty transaction array

* clear form when changing type

* clone safe on mount

* better validation, state setting for nft trasnfer & token transfer

* keep validation logic in components, emit isValid flag

* check contract interaction params

* enforce positive value for sending tokens

* remove top level valid flag

* handle value validation

* set invalid method params for validation

* validate raw tx inputs

* disable publish if osnap tx invalid

* set state upstream even if invalid, better input logic

* don't allow empty transaction array

* clear form when changing type

* clone safe on mount

* better validation, state setting for nft trasnfer & token transfer

* keep validation logic in components, emit isValid flag

* check contract interaction params

* enforce positive value for sending tokens

* remove top level valid flag

* handle value validation

* set invalid method params for validation

* validate raw tx inputs

* remove error message for decimal values

* pad bytes32

* clean up

---------

Co-authored-by: Gerhard Steenkamp <[email protected]>

* fix: fix wrong test button color on custom domain

---------

Co-authored-by: Sam <[email protected]>
Co-authored-by: David A <[email protected]>
Co-authored-by: Gerhard Steenkamp <[email protected]>
  • Loading branch information
4 people authored Feb 17, 2024
1 parent c6f727a commit 41b394b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/Tune/TuneButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ withDefaults(
}
);
const skin = ref<string | null>(null);
const { domain } = useApp();
const { getSkin } = useSkin();
onMounted(async () => await getSkin(domain));
</script>

<template>
Expand All @@ -28,7 +33,7 @@ const { domain } = useApp();
primary: primary,
danger: variant === 'danger',
disabled: disabled,
'!text-skin-bg': !domain && primary
'!text-skin-bg': !skin && primary
}
]"
:disabled="disabled || loading"
Expand Down
6 changes: 5 additions & 1 deletion src/composables/useSkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const skinClass = ref('default');
export function useSkin() {
const { apolloQuery } = useApolloQuery();

async function getSkin(domain: string) {
async function getSkin(domain: string): Promise<string | null> {
if (domain) {
const space = await apolloQuery(
{
Expand All @@ -41,8 +41,12 @@ export function useSkin() {
if (space?.skin) {
skinClass.value = space.skin;
document.body.classList.add(skinClass.value);

return space.skin;
}
}

return null;
}

const getThemeIcon = () => (theme.value === LIGHT ? 'moon' : 'sun');
Expand Down

0 comments on commit 41b394b

Please sign in to comment.