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

View File

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

View File

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