mirror of
https://github.com/web3privacy/explorer-app.git
synced 2024-10-15 16:46:26 +02:00
Merge pull request #59 from web3privacy/dw/fix-project-status
Project status fix
This commit is contained in:
commit
d41f3af249
2 changed files with 11 additions and 7 deletions
|
@ -5,7 +5,7 @@ const props = defineProps<{
|
||||||
project?: Partial<Project>
|
project?: Partial<Project>
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const version = ref(props.project?.project_phase?.toLowerCase() || undefined)
|
const version = ref(props.project?.project_phase ? props.project?.project_phase?.toLowerCase() : props.project?.project_status?.version ? props.project?.project_status?.version.toLowerCase() : undefined)
|
||||||
const openSource = ref(props.project?.blockchain_features?.opensource || false)
|
const openSource = ref(props.project?.blockchain_features?.opensource || false)
|
||||||
const upgradability = ref(props.project?.blockchain_features?.upgradability?.enabled || false)
|
const upgradability = ref(props.project?.blockchain_features?.upgradability?.enabled || false)
|
||||||
const assetType = ref(props.project?.blockchain_features?.asset_custody_type?.toLowerCase() || '')
|
const assetType = ref(props.project?.blockchain_features?.asset_custody_type?.toLowerCase() || '')
|
||||||
|
@ -19,6 +19,12 @@ const { saveProject } = useProject()
|
||||||
function save() {
|
function save() {
|
||||||
saveProject({
|
saveProject({
|
||||||
project_phase: version.value,
|
project_phase: version.value,
|
||||||
|
project_status: {
|
||||||
|
live_status: version.value ? true : false,
|
||||||
|
mainnet: version.value === 'mainnet' ? true : false,
|
||||||
|
testnet: version.value === 'testnet' ? true : false,
|
||||||
|
version: version.value,
|
||||||
|
},
|
||||||
blockchain_features: {
|
blockchain_features: {
|
||||||
opensource: openSource.value,
|
opensource: openSource.value,
|
||||||
upgradability: {
|
upgradability: {
|
||||||
|
|
|
@ -4,8 +4,6 @@ import type { Project } from '~/types'
|
||||||
defineProps<{
|
defineProps<{
|
||||||
project: Project
|
project: Project
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { projectPhase } = storeToRefs(useData())
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -62,12 +60,12 @@ const { projectPhase } = storeToRefs(useData())
|
||||||
h-10px
|
h-10px
|
||||||
w-10px
|
w-10px
|
||||||
rounded-full
|
rounded-full
|
||||||
:class=" project.project_phase ? 'bg-green' : 'bg-red'"
|
:class=" project.project_status?.version ? 'bg-green' : 'bg-red'"
|
||||||
/><p
|
/><p
|
||||||
:class="project.project_phase ? 'text-white' : 'text-app-text-grey'"
|
:class="project.project_status?.version ? 'text-white' : 'text-app-text-grey'"
|
||||||
leading="20px lg:24px"
|
leading="20px lg:24px"
|
||||||
>
|
>
|
||||||
{{ projectPhase.find(p => p.id === project.project_phase)?.name || 'N/A' }}
|
{{ project.project_status?.version ? `${project.project_status?.version?.charAt(0).toUpperCase()}${project.project_status?.version?.slice(1)}` : 'N/A' }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -113,7 +111,7 @@ const { projectPhase } = storeToRefs(useData())
|
||||||
leading="20px lg:24px"
|
leading="20px lg:24px"
|
||||||
:class=" project.product_launch_day ? '' : 'opacity-50'"
|
:class=" project.product_launch_day ? '' : 'opacity-50'"
|
||||||
>
|
>
|
||||||
{{ project.product_launch_day || 'N/A' }}
|
{{ project.product_launch_day ? new Intl.DateTimeFormat('en-UK').format(new Date(project.product_launch_day)) : 'N/A' }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue