mirror of
https://github.com/logos-storage/ethcc-demo.git
synced 2026-01-07 15:43:11 +00:00
CodexImage, SpinnerLoading, and IndicatorBadge sizing
This commit is contained in:
parent
a6225b9f6a
commit
81eb1a4bcd
@ -1,6 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { inject, ref, onMounted, computed } from 'vue'
|
import { inject, ref, onMounted, computed } from 'vue'
|
||||||
import { initModals } from 'flowbite'
|
|
||||||
import SpinnerLoading from '@/components/SpinnerLoading.vue'
|
import SpinnerLoading from '@/components/SpinnerLoading.vue'
|
||||||
|
|
||||||
const codexApi = inject('codexApi')
|
const codexApi = inject('codexApi')
|
||||||
@ -8,10 +7,6 @@ const loading = ref(false)
|
|||||||
const imgSrc = ref('')
|
const imgSrc = ref('')
|
||||||
const error = ref('')
|
const error = ref('')
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
inheritAttrs: false
|
|
||||||
})
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
cid: {
|
cid: {
|
||||||
type: [String, undefined]
|
type: [String, undefined]
|
||||||
@ -71,6 +66,6 @@ onMounted(async () => {
|
|||||||
<span class="sr-only">{{ error }}</span>
|
<span class="sr-only">{{ error }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img v-bind="$attrs" v-else-if="imgSrc" :src="imgSrc" class="rounded-full" :alt="props.alt" />
|
<img v-else-if="imgSrc" :src="imgSrc" class="rounded-full" :alt="props.alt" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div role="status">
|
<div role="status" class="inline-block">
|
||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
|
class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
|
||||||
|
|||||||
@ -13,6 +13,15 @@ const props = defineProps({
|
|||||||
text: {
|
text: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default() {
|
||||||
|
return 'sm'
|
||||||
|
},
|
||||||
|
validator(value, props) {
|
||||||
|
return ['sm', 'lg'].includes(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -59,14 +68,35 @@ const theme = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const size = computed(() => {
|
||||||
|
if (props.size === 'sm') {
|
||||||
|
return {
|
||||||
|
fontSize: 'text-xs',
|
||||||
|
bubbleWidth: 'w-2',
|
||||||
|
bubbleHeight: 'h-2',
|
||||||
|
bubbleMargin: 'me-1'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
fontSize: 'text-md',
|
||||||
|
bubbleWidth: 'w-3',
|
||||||
|
bubbleHeight: 'h-3',
|
||||||
|
bubbleMargin: 'me-2'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<span
|
<span
|
||||||
class="inline-flex items-center text-xs font-medium px-2.5 py-0.5 rounded-full"
|
class="inline-flex items-center font-medium px-2.5 py-0.5 rounded-full"
|
||||||
:class="[theme.bg, theme.text, theme.bgDark, theme.textDark]"
|
:class="[theme.bg, theme.text, theme.bgDark, theme.textDark, size.fontSize]"
|
||||||
>
|
>
|
||||||
<span class="w-2 h-2 me-1 rounded-full" :class="theme.bgDot"></span>
|
<span
|
||||||
|
class="w-2 h-2 me-1 rounded-full"
|
||||||
|
:class="[theme.bgDot, size.bubbleWidth, size.bubbleHeight, size.bubbleMargin]"
|
||||||
|
></span>
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -22,16 +22,19 @@ const totalPrice = computed(() => price(props.request))
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex">
|
<div class="flex flex-wrap">
|
||||||
<CodexImage class="flex-2" :cid="request.content.cid"></CodexImage>
|
<CodexImage class="flex-initial mx-auto my-8 lg:my-16 min-w-sm max-w-md w-full
|
||||||
<div class="py-8 px-4 mx-auto max-w-2xl lg:py-16">
|
rounded" :cid="request.content.cid" :local-only="!['New',
|
||||||
|
'Fulfilled'].includes(request.state)"></CodexImage>
|
||||||
|
<div class="py-8 px-4 ml-4 max-w-2xl lg:py-16 flex-1">
|
||||||
<div class="flex justify-between items-center mb-2">
|
<div class="flex justify-between items-center mb-2">
|
||||||
<h2 class="text-xl font-semibold leading-none text-gray-900 md:text-2xl dark:text-white">
|
<h2 class="text-xl font-semibold leading-none text-gray-900 md:text-2xl dark:text-white">
|
||||||
Request {{ shortHex(requestId, 12) }}
|
Request {{ shortHex(requestId, 8) }}
|
||||||
</h2>
|
</h2>
|
||||||
<StateIndicator
|
<StateIndicator
|
||||||
:text="request.state"
|
:text="request.state"
|
||||||
:color="getStateColour(request.state)"
|
:color="getStateColour(request.state)"
|
||||||
|
size="lg"
|
||||||
></StateIndicator>
|
></StateIndicator>
|
||||||
</div>
|
</div>
|
||||||
<p class="mb-4 text-xl font-extrabold leading-none text-gray-900
|
<p class="mb-4 text-xl font-extrabold leading-none text-gray-900
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user