Commit 5e4a517b authored by Bitcoin Please's avatar Bitcoin Please
Browse files

Added category display.

parent 481819aa
{
"name": "causes-cash",
"version": "20.6.25",
"version": "20.7.25",
"license": "MIT",
"author": "Bitcoin Cash Please <support@bchplease.org>",
"description": "An uncensorable funding platform for radical creators and unstoppable service providers.",
......
......@@ -440,7 +440,7 @@ button {
background-color: #0094d2;
} */
.markdown a {
.markdown a, .campaigns a {
display: inline-block;
}
</style>
......@@ -4,6 +4,7 @@
/* Import modules (getters). */
import getBytesFromIPFS from './utils/getters/getBytesFromIPFS'
import getCompletedPct from './utils/getters/getCompletedPct'
import getCategoryDisplay from './utils/getters/getCategoryDisplay'
import getFormatFunded from './utils/getters/getFormatFunded'
import getFormattedValue from './utils/getters/getFormattedValue'
import getIPFSFromBytes from './utils/getters/getIPFSFromBytes'
......@@ -24,6 +25,7 @@ const state = {
/* Getters. */
const getters = {
getBytesFromIPFS,
getCategoryDisplay,
getCompletedPct,
getFormatFunded,
getFormattedValue,
......
/**
* Get Category Display
*
* Formatted for display purposes.
*/
const getCategoryDisplay = () => (_category) => {
switch(_category) {
case 'adoption':
return 'Adoption'
case 'community':
return 'Community'
case 'dapp':
return 'Decentralized App'
case 'design-art':
return 'Design & Art'
case 'education':
return 'Education'
case 'film-video':
return 'Film & Video'
case 'fun-games':
return 'Fun & Games'
case 'hardware':
return 'Hardware'
case 'health-wellness':
return 'Health & Wellness'
case 'infrastructure':
return 'Infrastructure'
case 'music':
return 'Music'
case 'privacy':
return 'Privacy'
case 'publishing':
return 'Publishing'
case 'security':
return 'Security'
case 'software':
return 'Software'
case 'world-view':
return 'World View'
case 'youth':
return 'Youth'
default:
return 'Unknown Category'
}
}
/* Export module. */
export default getCategoryDisplay
......@@ -21,12 +21,24 @@
<hr v-if="index !== 0" />
<div class="campaign-box">
<router-link :to="campaign.slug + '-null'" class="campaign-image">
<img :src="campaign.media ? campaign.media.main : null" :alt="campaign.title">
</router-link>
<div class="ml-3 mb-5 float-right">
<router-link :to="campaign.slug + '-null'" class="campaign-image">
<img :src="campaign.media ? campaign.media.main : null" :alt="campaign.title">
</router-link>
<div class="text-center">
<router-link :to="campaign.slug + '-null'">
open live
</router-link>
|
<router-link :to="campaign.slug + '/manage'">
manage
</router-link>
</div>
</div>
<div class="campaign-category">
{{campaign.category}}
{{formatCategory(campaign.category)}}
</div>
<div class="campaign-title">
......@@ -130,6 +142,7 @@ export default {
]),
...mapGetters('utils', [
'getCategoryDisplay',
'getMarkdown',
]),
......@@ -166,6 +179,17 @@ export default {
}
},
/**
* Format Category
*/
formatCategory(_category) {
if (_category) {
return this.getCategoryDisplay(_category)
} else {
return null
}
},
},
created: async function () {
/* Set owner slug. */
......@@ -207,4 +231,5 @@ export default {
font-size: 1.6em;
font-weight: bold;
}
</style>
......@@ -204,6 +204,7 @@ export default {
]),
...mapGetters('utils', [
'getCategoryDisplay',
'getMarkdown',
]),
......@@ -212,44 +213,7 @@ export default {
*/
category() {
if (this.campaign && this.campaign.category) {
switch(this.campaign.category) {
case 'adoption':
return 'Adoption'
case 'community':
return 'Community'
case 'dapp':
return 'Decentralized App'
case 'design-art':
return 'Design & Art'
case 'education':
return 'Education'
case 'film-video':
return 'Film & Video'
case 'fun-games':
return 'Fun & Games'
case 'hardware':
return 'Hardware'
case 'health-wellness':
return 'Health & Wellness'
case 'infrastructure':
return 'Infrastructure'
case 'music':
return 'Music'
case 'privacy':
return 'Privacy'
case 'publishing':
return 'Publishing'
case 'security':
return 'Security'
case 'software':
return 'Software'
case 'world-view':
return 'World View'
case 'youth':
return 'Youth'
default:
return 'Unknown Category'
}
return this.getCategoryDisplay(this.campaign.category)
} else {
return null
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment