changing to components
This commit is contained in:
parent
e42b5820b8
commit
f992da95ab
10 changed files with 123 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
.select-car {
|
.select-car {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
.select-car-form {
|
.select-car-form, .car_info, .radio_question {
|
||||||
background: $white;
|
background: $white;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
@click="backFunction ? backFunction() : null"
|
@click="backFunction ? backFunction() : null"
|
||||||
>
|
>
|
||||||
<div class="d-flex align-items-center justify-content-center">
|
<div class="d-flex align-items-center justify-content-center">
|
||||||
<span class="text-center text-secondary fs-5 d-block">{{
|
<span class="text-center text-dark fs-5 d-block">{{
|
||||||
this.currentCarInfo
|
this.currentCarInfo
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-if="backFunction" class="back-button"><img src="@/assets/img/icons/back-forward.svg" alt="back-button"></span>
|
<span v-if="backFunction" class="back-button"><img src="@/assets/img/icons/back-forward.svg" alt="back-button"></span>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="style" class="text-center text-secondary fs-6 mt-2">{{
|
<span v-if="style" class="text-center text-dark fs-6 mt-2">{{
|
||||||
style
|
style
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
1
src/commonComponents/radioQuestion/radioQuestion.spec.js
Normal file
1
src/commonComponents/radioQuestion/radioQuestion.spec.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
test.todo('some test to be written in the future');
|
||||||
28
src/commonComponents/radioQuestion/radioQuestion.vue
Normal file
28
src/commonComponents/radioQuestion/radioQuestion.vue
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<template>
|
||||||
|
<div class="radio_question">
|
||||||
|
<div class="needed_car_info d-flex mt-4 mb-3">
|
||||||
|
<span class="text-center fs-6 fw-bold needed_car_info-text">{{ questionText }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="list-view d-flex">
|
||||||
|
<div class="car_list">
|
||||||
|
<div v-for="answer in answers" :key="answer" class="mb-2">
|
||||||
|
<radio :text="answer" :value="answer" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import radio from "@/uxComponents/radio/radio";
|
||||||
|
export default {
|
||||||
|
name: "radio-question",
|
||||||
|
props: {
|
||||||
|
questionText: String,
|
||||||
|
answers: Array
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
radio
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -79,6 +79,16 @@
|
||||||
<h6>h6 Heading</h6>
|
<h6>h6 Heading</h6>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="my-3">
|
||||||
|
<div class="select-car">
|
||||||
|
<div class="select-car-form">
|
||||||
|
<radioQuestion
|
||||||
|
questionText="What year is your vehicle?"
|
||||||
|
:answers="this.years"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -86,12 +96,19 @@
|
||||||
import buttonPrimary from "@/uxComponents/buttonPrimary/buttonPrimary";
|
import buttonPrimary from "@/uxComponents/buttonPrimary/buttonPrimary";
|
||||||
import radioCard from "@/uxComponents/radioCard/radioCard";
|
import radioCard from "@/uxComponents/radioCard/radioCard";
|
||||||
import listButton from "@/uxComponents/listButton/listButton";
|
import listButton from "@/uxComponents/listButton/listButton";
|
||||||
|
import radioQuestion from "@/commonComponents/radioQuestion/radioQuestion";
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {
|
components: {
|
||||||
buttonPrimary,
|
buttonPrimary,
|
||||||
radioCard,
|
radioCard,
|
||||||
listButton
|
listButton,
|
||||||
|
radioQuestion
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
years: [2023, 2022, 2021, 2020],
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="select-car sticky-lg-top py-4">
|
||||||
<baseTemplate
|
<div class="select-car-form overflow-hidden p-3 rounded">
|
||||||
currentCarInfo="Select a year to get started"
|
<div class="car_info text-center">
|
||||||
neededCarInfo="What year is your vehicle?"
|
<Header
|
||||||
>
|
text="Select a year to get started"
|
||||||
<carAttributes :attritbutes="years" :selectAttribute="selectYear" />
|
/>
|
||||||
</baseTemplate>
|
<radioQuestion
|
||||||
|
questionText="What year is your vehicle?"
|
||||||
|
:answers="this.years"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
|
import radioQuestion from "@/commonComponents/radioQuestion/radioQuestion";
|
||||||
import carAttributes from "@/commonComponents/carAttributes/carAttributes";
|
import Header from "@/uxComponents/header/header";
|
||||||
import { endpoints } from "@/constants/endpoints.js";
|
import { endpoints } from "@/constants/endpoints.js";
|
||||||
import globalMethods from "@/global-methods";
|
import globalMethods from "@/global-methods";
|
||||||
|
|
||||||
|
|
@ -40,8 +45,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
baseTemplate,
|
radioQuestion,
|
||||||
carAttributes,
|
Header,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
1
src/uxComponents/header/header.spec.js
Normal file
1
src/uxComponents/header/header.spec.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
test.todo('some test to be written in the future');
|
||||||
16
src/uxComponents/header/header.vue
Normal file
16
src/uxComponents/header/header.vue
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<template>
|
||||||
|
<div class="current_car_info-text">
|
||||||
|
<div class="d-flex align-items-center justify-content-center">
|
||||||
|
<span class="text-center text-dark fs-5 d-block">{{ text }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Header",
|
||||||
|
props: {
|
||||||
|
text: String
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
1
src/uxComponents/radio/radio.spec.js
Normal file
1
src/uxComponents/radio/radio.spec.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
test.todo('some test to be written in the future');
|
||||||
39
src/uxComponents/radio/radio.vue
Normal file
39
src/uxComponents/radio/radio.vue
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
:id="this.value"
|
||||||
|
:value="this.value"
|
||||||
|
class="position-absolute opacity-0"
|
||||||
|
v-on:click="showLoader()"
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
:for="this.value"
|
||||||
|
class="btn list-button d-flex align-items-center"
|
||||||
|
v-bind:class="[this.isLoading ? 'button-loader' : '']"
|
||||||
|
>
|
||||||
|
<span>{{ text }}</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "radio",
|
||||||
|
props: {
|
||||||
|
value: String,
|
||||||
|
text: String
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isLoading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLoader() {
|
||||||
|
this.isLoading = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in a new issue