Skip to content

Commit

Permalink
fix: remove value variable from the CheckBoxInput component
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk committed Feb 5, 2024
1 parent 3688a42 commit 82b5353
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
3 changes: 0 additions & 3 deletions packages/app/src/components/common/CheckBoxInput.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
};

type Args = {
value: boolean;
modelValue: boolean;
};

Expand All @@ -21,12 +20,10 @@ const Template = (args: Args) => ({

export const Checked = Template.bind({}) as unknown as { args: Args };
Checked.args = {
value: true,
modelValue: true,
};

export const Unchecked = Template.bind({}) as unknown as { args: Args };
Unchecked.args = {
value: false,
modelValue: false,
};
8 changes: 2 additions & 6 deletions packages/app/src/components/common/CheckBoxInput.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<label class="checkbox-input-container" :class="{ checked: value }">
<input type="checkbox" :checked="value" v-model="inputted" v-bind="$attrs" />
<label class="checkbox-input-container" :class="{ checked: inputted }">
<input type="checkbox" :checked="inputted" v-model="inputted" v-bind="$attrs" />
<slot />
</label>
</template>
Expand All @@ -18,10 +18,6 @@ const props = defineProps({
type: Boolean,
default: null,
},
value: {
type: Boolean,
required: true,
},
});
const emit = defineEmits<{
(eventName: "update:modelValue", value: unknown): void;
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/views/ContractVerificationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
<CheckBoxInput
v-if="selectedCompiler.name === CompilerEnum.solc"
v-model="isZkVMSolcCompiler"
:value="false"
@update:model-value="onZkVMSelectionChanged"
>{{ t("contractVerification.form.solcVersion.zkVM") }}</CheckBoxInput
>
Expand Down
4 changes: 1 addition & 3 deletions packages/app/tests/components/common/CheckBoxInput.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("CheckBoxInput", () => {
},
},
props: {
value: true,
modelValue: true,
},
});
expect(container.textContent).toBe("CheckBox Input");
Expand All @@ -22,7 +22,6 @@ describe("CheckBoxInput", () => {
const { container } = render(CheckBoxInput, {
props: {
modelValue: true,
value: true,
},
});
expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(true);
Expand All @@ -32,7 +31,6 @@ describe("CheckBoxInput", () => {
const { container } = render(CheckBoxInput, {
props: {
modelValue: false,
value: false,
},
});
expect(container.querySelector(".checkbox-input-container")!.classList.contains("checked")).toBe(false);
Expand Down

0 comments on commit 82b5353

Please sign in to comment.