Extract an action card button component
This commit is contained in:
parent
2c20c14b53
commit
e48ada8c59
20
src/components/Environment/ActionCardButton.vue
Normal file
20
src/components/Environment/ActionCardButton.vue
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
||||||
|
<slot></slot>
|
||||||
|
<span class="block" v-text="label"></span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
label: { type: String },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
svg {
|
||||||
|
@apply h-6 w-6 fill-current mb-2
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -28,17 +28,15 @@
|
||||||
<div>
|
<div>
|
||||||
<ul class="list-reset flex -ml-px">
|
<ul class="list-reset flex -ml-px">
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
<action-card-button label="Deploy">
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#objects__fork"></use></svg>
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#objects__fork"></use></svg>
|
||||||
<span class="block">Deploy</span>
|
</action-card-button>
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
<action-card-button label="Switch">
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__switch"></use></svg>
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__switch"></use></svg>
|
||||||
<span class="block">Switch</span>
|
</action-card-button>
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,32 +65,24 @@
|
||||||
<div>
|
<div>
|
||||||
<ul class="list-reset flex -ml-px">
|
<ul class="list-reset flex -ml-px">
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
<action-card-button label="Copy">
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__copy"></use></svg>
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__copy"></use></svg>
|
||||||
<span class="block">Copy</span>
|
</action-card-button>
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
<action-card-button label="Back up">
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__backup"></use></svg>
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__backup"></use></svg>
|
||||||
<span class="block">Back up</span>
|
</action-card-button>
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button
|
<action-card-button label="Restore" :disabled="isProduction" :class="{
|
||||||
type="button"
|
|
||||||
class="w-full flex flex-col items-center py-3 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block"
|
|
||||||
:class="{
|
|
||||||
'text-blue-300': !isProduction,
|
'text-blue-300': !isProduction,
|
||||||
'text-grey-500 cursor-not-allowed': isProduction
|
'text-grey-500 cursor-not-allowed': isProduction
|
||||||
}"
|
}">
|
||||||
:disabled="isProduction"
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__restore"></use></svg>
|
||||||
>
|
</action-card-button>
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__restore"></use></svg>
|
|
||||||
<span class="block">Restore</span>
|
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,10 +111,9 @@
|
||||||
<div>
|
<div>
|
||||||
<ul class="list-reset flex -ml-px">
|
<ul class="list-reset flex -ml-px">
|
||||||
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
<li class="w-1/2 flex-1 text-center border-l border-grey-400">
|
||||||
<button type="button" class="w-full flex flex-col items-center py-3 text-blue-300 text-xs font-bold no-underline hover:underline focus:underline hover:bg-grey-200 focus:bg-grey-lighter focus:outline-none block">
|
<action-card-button label="Copy">
|
||||||
<svg class="h-6 w-6 fill-current mb-2" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__copy"></use></svg>
|
<svg role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__copy"></use></svg>
|
||||||
<span class="block">Copy</span>
|
</action-card-button>
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -137,7 +126,11 @@
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ActionCardButton from '@/components/Environment/ActionCardButton'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { ActionCardButton },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
environment: Object,
|
environment: Object,
|
||||||
isProduction: Boolean
|
isProduction: Boolean
|
||||||
|
|
Reference in a new issue