Update buttons to use one button for all instances (so far).
This commit is contained in:
parent
7f4aa2ceb0
commit
868897f0d2
3 changed files with 36 additions and 25 deletions
|
|
@ -40,29 +40,24 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimary
|
<buttonPrimary
|
||||||
btnText="Primary"
|
buttonText="Primary"
|
||||||
|
buttonType="btn-primary"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimaryFocus
|
<buttonPrimary
|
||||||
btnText="Primary Focus"
|
buttonText="Primary Focus"
|
||||||
|
buttonType="btn-primary-focus"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col my-3 d-flex align-items-center">
|
<div class="col my-3 d-flex align-items-center">
|
||||||
<buttonPrimary class="button-loader"
|
<buttonPrimary
|
||||||
btnText="w/Loader"
|
buttonText="Disabled"
|
||||||
btnClass="test"
|
buttonType="disabled"
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col my-3 d-flex align-items-center">
|
|
||||||
<buttonDisabled
|
|
||||||
btnText="Disabled"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -75,8 +70,6 @@
|
||||||
import imageButton from './components/imageButton';
|
import imageButton from './components/imageButton';
|
||||||
import confetti from './components/confetti';
|
import confetti from './components/confetti';
|
||||||
import buttonPrimary from './components/buttons/buttonPrimary';
|
import buttonPrimary from './components/buttons/buttonPrimary';
|
||||||
import buttonPrimaryFocus from './components/buttons/buttonPrimaryFocus';
|
|
||||||
import buttonDisabled from './components/buttons/buttonDisabled';
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -86,9 +79,7 @@
|
||||||
vehicleImage,
|
vehicleImage,
|
||||||
imageButton,
|
imageButton,
|
||||||
confetti,
|
confetti,
|
||||||
buttonPrimary,
|
buttonPrimary
|
||||||
buttonPrimaryFocus,
|
|
||||||
buttonDisabled
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:disabled {
|
}
|
||||||
|
&.disabled {
|
||||||
background: $gray-100;
|
background: $gray-100;
|
||||||
background: linear-gradient(270deg, $gray-100 0%, $gray-100 100%);
|
background: linear-gradient(270deg, $gray-100 0%, $gray-100 100%);
|
||||||
color: $gray-400;
|
color: $gray-400;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
&.btn-primary-focus {
|
&.btn-primary-focus {
|
||||||
position: relative;//Required for :after pseduo to position correctly
|
position: relative;//Required for :after pseduo to position correctly
|
||||||
margin: 5px;//Because :after is position absolute and isn't accounted for in DOM
|
margin: 5px;//Because :after is position absolute and isn't accounted for in DOM
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<button type="button" class="btn btn-primary d-flex align-items-center">{{btnText}}</button>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn d-flex align-items-center"
|
||||||
|
v-on:click="showLoader()"
|
||||||
|
v-bind:class="[(this.isLoading ? 'button-loader' : 'not-loading'),this.buttonType]"
|
||||||
|
>
|
||||||
|
{{ this.buttonText }}
|
||||||
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'buttonPrimary',
|
name: 'buttonPrimary',
|
||||||
props: ['btnText']
|
props: {
|
||||||
|
buttonText: String,
|
||||||
|
buttonType: String
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
isLoading: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLoader(){
|
||||||
|
this.isLoading = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue