1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

category fixes

* remove slugify from all select values
* so categories defined in form-publish.json are stored when publishing
* map categories to category images
* add jellyfish background as fallback image
This commit is contained in:
Matthias Kretschmann 2019-04-05 14:55:01 +02:00
parent cd0ca3045e
commit 4bd455c1ae
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 38 additions and 8 deletions

View File

@ -5,5 +5,5 @@
background-size: cover;
background-position: center;
margin-bottom: $spacer / $line-height;
background-color: $brand-grey-lighter;
background-color: $body-background;
}

View File

@ -33,75 +33,108 @@ import theology from '../../img/categories/theology.jpg'
import transport from '../../img/categories/transport.jpg'
import urbanplanning from '../../img/categories/urbanplanning.jpg'
import visualart from '../../img/categories/visualart.jpg'
import fallback from '@oceanprotocol/art/jellyfish/jellyfish-back.svg'
const categoryImageFile = (category: string) => {
switch (category) {
case 'Agriculture & Bio Engineering':
case 'agriculture':
return agriculture
case 'Anthropology & Archeology':
case 'anthroarche':
return anthroarche
case 'Space & Astronomy':
case 'astronomy':
return astronomy
case 'Biology':
case 'biology':
return biology
case 'Business & Management':
case 'business':
return business
case 'Chemistry':
case 'chemistry':
return chemistry
case 'Communication & Journalism':
case 'communication':
return communication
case 'Computer Technology':
case 'computer':
return computer
case 'Dataset Of Datasets':
case 'dataofdata':
return dataofdata
case 'Deep Learning':
case 'deeplearning':
return deeplearning
case 'Demography':
case 'demographics':
return demographics
case 'Earth & Climate':
case 'earth':
return earth
case 'Economics & Finance':
case 'economics-and-finance':
return economics
case 'Engineering':
case 'engineering':
return engineering
case 'History':
case 'history':
return history
case 'Image Recognition':
case 'imagesets':
return imagesets
case 'Language':
case 'language':
return language
case 'Law':
case 'law':
return law
case 'Mathematics':
case 'mathematics':
return mathematics
case 'Medicine':
case 'medicine':
return medicine
case 'Other':
case 'other':
return other
case 'Performing Arts':
case 'performingarts':
return performingarts
case 'Philosophy':
case 'philosophy':
return philosophy
case 'Physics & Energy':
case 'physics':
return physics
case 'Politics':
case 'politics':
return politics
case 'Psychology':
case 'psychology':
return psychology
case 'Sociology':
case 'sociology':
return sociology
case 'Sports & Recreation':
case 'sports':
return sports
case 'Theology':
case 'theology':
return theology
case 'Transportation':
case 'transport':
return transport
case 'Urban Plannin':
case 'urbanplanning':
return urbanplanning
case 'Visual Arts & Design':
case 'visualart':
return visualart
default:
break
return fallback
}
}

View File

@ -98,12 +98,7 @@ export default class Input extends PureComponent<InputProps, InputState> {
options
.sort((a, b) => a.localeCompare(b))
.map((option: string, index: number) => (
<option
key={index}
value={slugify(option, {
lower: true
})}
>
<option key={index} value={option}>
{option}
</option>
))}

View File

@ -68,6 +68,8 @@
"Business & Management",
"Sports & Recreation",
"Communication & Journalism",
"Deep Learning",
"Law",
"Other"
]
},