Skip to content

Commit

Permalink
refactor bet steps position on players setup
Browse files Browse the repository at this point in the history
  • Loading branch information
maldestor95 committed May 8, 2024
1 parent 151219f commit 3c3e878
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
38 changes: 23 additions & 15 deletions src/pages/wizard/definesteps.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<template>
<form class="text-left">
<h3>
<slot>Choose the steps</slot>
</h3>
<div v-for="(option, index) in choices" :key="index" class="flex">
<input
type="radio"
:name="choice"
:value="option.id"
@click="updateSteps(option.id)"
/>
<label :for="option.id" class="ml-2 pt-2">{{ option.opt.join("\ \ \ \ ") }}</label>
<br />
</div>
</form>
<div>
<form class="text-left">
<h3>
<slot>Choose the steps</slot>
</h3>
<div v-for="(option, index) in choices" :key="index" class="flex">
<input
type="radio"
:name="choice"
:value="option.id"
:disabled="!disabled"
@click="updateSteps(option.id)"
/>
<label :for="option.id" class="ml-2 pt-2">{{
option.opt.join("\ \ \ \ ")
}}</label>
<br />
</div>
</form>
</div>
</template>

<script setup lang="ts">
import { reactive, ref } from "vue";
type stepsType = number[];
type Props = {
steps?: number[];
disabled: boolean;
};
const emit = defineEmits<{
Expand All @@ -31,6 +38,7 @@ const props = withDefaults(defineProps<Props>(), {
steps: () => {
return [-5, -2, -1, 1, 2, 5];
},
disabled: false,
});
const choice = ref("opt1");
Expand Down
9 changes: 5 additions & 4 deletions src/pages/wizard/players.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<toggleSwitch v-model="showStepsSetup" square class="text-black justify-self-end"
>Steps Setup</toggleSwitch
>
<toggleSwitch v-model="store.trackBets" square class="text-black justify-self-end"
>Bets
</toggleSwitch>
</div>
</container>

Expand All @@ -31,14 +28,18 @@
>ROUND STEPS</defineSteps
>
</container>
<container class="basis-full pl-4 md:basis-1/2" v-if="store.trackBets">
<container class="basis-full pl-4 md:basis-1/2">
<toggleSwitch v-model="store.trackBets" square class="text-black justify-self-end"
>Bets
</toggleSwitch>
<defineSteps
:steps="store.betSteps"
@change="
(ev) => {
store.betSteps = ev;
}
"
:disabled="store.trackBets"
>BETS STEPS</defineSteps
></container
>
Expand Down

0 comments on commit 3c3e878

Please sign in to comment.