Button and transition updates
This commit is contained in:
parent
1ff96792dc
commit
c24cb57863
8 changed files with 36 additions and 20 deletions
|
|
@ -17,4 +17,8 @@
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.btn-funnel {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="current_car_info mb-4">
|
<div class="current_car_info mb-4">
|
||||||
<transition appear name="fade">
|
<transition appear name="fade">
|
||||||
<div v-if="backFunction" class="current_car_info-text" v-on:click="backFunction()">
|
<div class="current_car_info-text" v-on:click="backFunction ? backFunction() : null">
|
||||||
<p class="text-center text-secondary fs-5">{{ this.currentCarInfo }}</p>
|
|
||||||
</div>
|
|
||||||
<div v-else class="current_car_info-text">
|
|
||||||
<p class="text-center text-secondary fs-5">{{ this.currentCarInfo }}</p>
|
<p class="text-center text-secondary fs-5">{{ this.currentCarInfo }}</p>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
@ -40,16 +37,19 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Button from '@/sharedcomponents/Button';
|
import Button from '@/sharedcomponents/Button';
|
||||||
|
import { mapState } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SCTemplate',
|
name: 'SCTemplate',
|
||||||
|
computed: {
|
||||||
|
...mapState(['slideTransition'])
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
currentCarInfo: String,
|
currentCarInfo: String,
|
||||||
neededCarInfo: String,
|
neededCarInfo: String,
|
||||||
attritbutes: Array,
|
attritbutes: Array,
|
||||||
backFunction: Function,
|
backFunction: Function,
|
||||||
selectAttribute: Function,
|
selectAttribute: Function
|
||||||
slideTransition: String
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Button
|
Button
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
:attritbutes="makes"
|
:attritbutes="makes"
|
||||||
:backFunction="goBack"
|
:backFunction="goBack"
|
||||||
:selectAttribute="selectMake"
|
:selectAttribute="selectMake"
|
||||||
:transition='slideTransition'
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -18,14 +17,14 @@ import { mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectCar',
|
name: 'SelectCar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['year', 'makes', 'slideTransition'])
|
...mapState(['year', 'makes'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectMake(make){
|
selectMake(make){
|
||||||
this.$store.dispatch('selectMake', make);
|
this.$store.dispatch('selectMake', make);
|
||||||
},
|
},
|
||||||
goBack(){
|
goBack(){
|
||||||
this.$store.state.slideTransition = 'slide_reverse'
|
this.$store.state.slideTransition = 'slide_reverse';
|
||||||
this.$router.push('/select-year');
|
this.$router.push('/select-year');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
:attritbutes="models"
|
:attritbutes="models"
|
||||||
:backFunction="goBack"
|
:backFunction="goBack"
|
||||||
:selectAttribute="selectModel"
|
:selectAttribute="selectModel"
|
||||||
:transition='slideTransition'
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -18,13 +17,14 @@ import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectCar',
|
name: 'SelectCar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['year', 'make', 'models', 'slideTransition'])
|
...mapState(['year', 'make', 'models'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectModel(model){
|
selectModel(model){
|
||||||
this.$store.dispatch('selectModel', model);
|
this.$store.dispatch('selectModel', model);
|
||||||
},
|
},
|
||||||
goBack(){
|
goBack(){
|
||||||
|
this.$store.state.slideTransition = 'slide_reverse';
|
||||||
this.$router.push(`/select-make?year=${this.$store.state.year}`);
|
this.$router.push(`/select-make?year=${this.$store.state.year}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
:neededCarInfo="'What style is your ' + model + '?'"
|
:neededCarInfo="'What style is your ' + model + '?'"
|
||||||
:attritbutes="styles"
|
:attritbutes="styles"
|
||||||
:backFunction="goBack"
|
:backFunction="goBack"
|
||||||
:transition='slideTransition'
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -17,10 +16,11 @@ import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectCar',
|
name: 'SelectCar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['year', 'make', 'model', 'styles', 'slideTransition'])
|
...mapState(['year', 'make', 'model', 'styles'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goBack(){
|
goBack(){
|
||||||
|
this.$store.state.slideTransition = 'slide_reverse';
|
||||||
this.$router.push(`/select-model?year=${this.$store.state.year}&make=${this.$store.state.make}`);
|
this.$router.push(`/select-model?year=${this.$store.state.year}&make=${this.$store.state.make}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,12 @@
|
||||||
neededCarInfo="What year is your vehicle?"
|
neededCarInfo="What year is your vehicle?"
|
||||||
:attritbutes="years"
|
:attritbutes="years"
|
||||||
:selectAttribute="selectYear"
|
:selectAttribute="selectYear"
|
||||||
:transition='slideTransition'
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseTemplate from './BaseTemplate';
|
import baseTemplate from './BaseTemplate';
|
||||||
import { mapState } from 'vuex';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -22,9 +20,6 @@ export default {
|
||||||
years: []
|
years: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
...mapState(['slideTransition'])
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
axios.get("https://mockey.qa.sagaws.net/service/years").then((response) => {
|
axios.get("https://mockey.qa.sagaws.net/service/years").then((response) => {
|
||||||
this.years = response.data.Result;
|
this.years = response.data.Result;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,15 @@
|
||||||
type="button"
|
type="button"
|
||||||
class="btn"
|
class="btn"
|
||||||
v-bind:class="this.buttonType === 'btn-funnel' ? ['btn-funnel', 'border', 'rounded', 'w-100', 'text-start'] : this.buttonType"
|
v-bind:class="this.buttonType === 'btn-funnel' ? ['btn-funnel', 'border', 'rounded', 'w-100', 'text-start'] : this.buttonType"
|
||||||
>{{ this.buttonText }}
|
v-on:click="this.buttonType === 'btn-funnel' ? showLoader() : null"
|
||||||
|
>
|
||||||
|
{{ this.buttonText }}
|
||||||
|
|
||||||
|
<!-- Spinner for funnel Button -->
|
||||||
|
<div v-if="this.buttonType === 'btn-funnel' && this.isLoading" class="spinner-border spinner-border-sm text-success" role="status">
|
||||||
|
<span class="visually-hidden">Loading...</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -13,6 +21,16 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
buttonText: String,
|
buttonText: String,
|
||||||
buttonType: String
|
buttonType: String
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
isLoading: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLoader(){
|
||||||
|
this.isLoading = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export default createStore({
|
||||||
year: '',
|
year: '',
|
||||||
make: '',
|
make: '',
|
||||||
model: '',
|
model: '',
|
||||||
slideTransition: 'none'
|
slideTransition: 'fade'
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
updateYear(state, data){
|
updateYear(state, data){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue