diff --git a/client/src/components/atoms/CategoryImage.module.scss b/client/src/components/atoms/CategoryImage.module.scss new file mode 100644 index 0000000..9ffc140 --- /dev/null +++ b/client/src/components/atoms/CategoryImage.module.scss @@ -0,0 +1,9 @@ +@import '../../styles/variables'; + +.categoryImage { + height: 4rem; + background-size: cover; + background-position: center; + margin-bottom: $spacer / $line-height; + background-color: $brand-grey-lighter; +} diff --git a/client/src/components/atoms/CategoryImage.tsx b/client/src/components/atoms/CategoryImage.tsx new file mode 100644 index 0000000..058290f --- /dev/null +++ b/client/src/components/atoms/CategoryImage.tsx @@ -0,0 +1,121 @@ +import React, { PureComponent } from 'react' +import styles from './CategoryImage.module.scss' + +import agriculture from '../../img/categories/agriculture.jpg' +import anthroarche from '../../img/categories/anthroarche.jpg' +import astronomy from '../../img/categories/astronomy.jpg' +import biology from '../../img/categories/biology.jpg' +import business from '../../img/categories/business.jpg' +import chemistry from '../../img/categories/chemistry.jpg' +import communication from '../../img/categories/communication.jpg' +import computer from '../../img/categories/computer.jpg' +import dataofdata from '../../img/categories/dataofdata.jpg' +import deeplearning from '../../img/categories/deeplearning.jpg' +import demographics from '../../img/categories/demographics.jpg' +import earth from '../../img/categories/earth.jpg' +import economics from '../../img/categories/economics.jpg' +import engineering from '../../img/categories/engineering.jpg' +import history from '../../img/categories/history.jpg' +import imagesets from '../../img/categories/imagesets.jpg' +import language from '../../img/categories/language.jpg' +import law from '../../img/categories/law.jpg' +import mathematics from '../../img/categories/mathematics.jpg' +import medicine from '../../img/categories/medicine.jpg' +import other from '../../img/categories/other.jpg' +import performingarts from '../../img/categories/performingarts.jpg' +import philosophy from '../../img/categories/philosophy.jpg' +import physics from '../../img/categories/physics.jpg' +import politics from '../../img/categories/politics.jpg' +import psychology from '../../img/categories/psychology.jpg' +import sociology from '../../img/categories/sociology.jpg' +import sports from '../../img/categories/sports.jpg' +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' + +const categoryImageFile = (category: string) => { + switch (category) { + case 'agriculture': + return agriculture + case 'anthroarche': + return anthroarche + case 'astronomy': + return astronomy + case 'biology': + return biology + case 'business': + return business + case 'chemistry': + return chemistry + case 'communication': + return communication + case 'computer': + return computer + case 'dataofdata': + return dataofdata + case 'deeplearning': + return deeplearning + case 'demographics': + return demographics + case 'earth': + return earth + case 'economics-and-finance': + return economics + case 'engineering': + return engineering + case 'history': + return history + case 'imagesets': + return imagesets + case 'language': + return language + case 'law': + return law + case 'mathematics': + return mathematics + case 'medicine': + return medicine + case 'other': + return other + case 'performingarts': + return performingarts + case 'philosophy': + return philosophy + case 'physics': + return physics + case 'politics': + return politics + case 'psychology': + return psychology + case 'sociology': + return sociology + case 'sports': + return sports + case 'theology': + return theology + case 'transport': + return transport + case 'urbanplanning': + return urbanplanning + case 'visualart': + return visualart + default: + break + } +} + +export default class CategoryImage extends PureComponent<{ category: string }> { + public render() { + const image = categoryImageFile(this.props.category) + + return ( +
+ ) + } +} diff --git a/client/src/components/molecules/Asset.module.scss b/client/src/components/molecules/Asset.module.scss index c172c22..9a7ffd3 100644 --- a/client/src/components/molecules/Asset.module.scss +++ b/client/src/components/molecules/Asset.module.scss @@ -9,6 +9,7 @@ border-radius: $border-radius; background: $brand-white; color: inherit; + position: relative; &:hover, &:focus { @@ -59,8 +60,6 @@ } .assetFooter { - border-top: 1px solid $brand-grey-lighter; - padding-top: $spacer / 2; margin-top: $spacer / 2; font-size: $font-size-small; color: $brand-grey-light; diff --git a/client/src/components/molecules/Asset.tsx b/client/src/components/molecules/Asset.tsx index d3a2922..c93bb15 100644 --- a/client/src/components/molecules/Asset.tsx +++ b/client/src/components/molecules/Asset.tsx @@ -2,6 +2,7 @@ import React from 'react' import { Link } from 'react-router-dom' import moment from 'moment' import styles from './Asset.module.scss' +import CategoryImage from '../atoms/CategoryImage' const AssetLink = ({ asset, list }: { asset: any; list?: boolean }) => { const { metadata } = asset.findServiceByType('Metadata') @@ -19,15 +20,12 @@ const AssetLink = ({ asset, list }: { asset: any; list?: boolean }) => { ) : (
+

{base.name}

-

{base.description.substring(0, 90)}

+

{base.description.substring(0, 90)}...

diff --git a/client/src/img/categories/agriculture.jpg b/client/src/img/categories/agriculture.jpg new file mode 100755 index 0000000..4ade120 Binary files /dev/null and b/client/src/img/categories/agriculture.jpg differ diff --git a/client/src/img/categories/anthroarche.jpg b/client/src/img/categories/anthroarche.jpg new file mode 100755 index 0000000..5db52b7 Binary files /dev/null and b/client/src/img/categories/anthroarche.jpg differ diff --git a/client/src/img/categories/astronomy.jpg b/client/src/img/categories/astronomy.jpg new file mode 100755 index 0000000..47922be Binary files /dev/null and b/client/src/img/categories/astronomy.jpg differ diff --git a/client/src/img/categories/biology.jpg b/client/src/img/categories/biology.jpg new file mode 100755 index 0000000..7f441c7 Binary files /dev/null and b/client/src/img/categories/biology.jpg differ diff --git a/client/src/img/categories/business.jpg b/client/src/img/categories/business.jpg new file mode 100755 index 0000000..c7ad302 Binary files /dev/null and b/client/src/img/categories/business.jpg differ diff --git a/client/src/img/categories/chemistry.jpg b/client/src/img/categories/chemistry.jpg new file mode 100755 index 0000000..1a21720 Binary files /dev/null and b/client/src/img/categories/chemistry.jpg differ diff --git a/client/src/img/categories/communication.jpg b/client/src/img/categories/communication.jpg new file mode 100755 index 0000000..c5e0b4c Binary files /dev/null and b/client/src/img/categories/communication.jpg differ diff --git a/client/src/img/categories/computer.jpg b/client/src/img/categories/computer.jpg new file mode 100755 index 0000000..dfd1d52 Binary files /dev/null and b/client/src/img/categories/computer.jpg differ diff --git a/client/src/img/categories/dataofdata.jpg b/client/src/img/categories/dataofdata.jpg new file mode 100755 index 0000000..66d20d8 Binary files /dev/null and b/client/src/img/categories/dataofdata.jpg differ diff --git a/client/src/img/categories/deeplearning.jpg b/client/src/img/categories/deeplearning.jpg new file mode 100755 index 0000000..faf4bf9 Binary files /dev/null and b/client/src/img/categories/deeplearning.jpg differ diff --git a/client/src/img/categories/demographics.jpg b/client/src/img/categories/demographics.jpg new file mode 100755 index 0000000..c8bad45 Binary files /dev/null and b/client/src/img/categories/demographics.jpg differ diff --git a/client/src/img/categories/earth.jpg b/client/src/img/categories/earth.jpg new file mode 100755 index 0000000..dc9e0b7 Binary files /dev/null and b/client/src/img/categories/earth.jpg differ diff --git a/client/src/img/categories/economics.jpg b/client/src/img/categories/economics.jpg new file mode 100755 index 0000000..1b99159 Binary files /dev/null and b/client/src/img/categories/economics.jpg differ diff --git a/client/src/img/categories/engineering.jpg b/client/src/img/categories/engineering.jpg new file mode 100755 index 0000000..9196e44 Binary files /dev/null and b/client/src/img/categories/engineering.jpg differ diff --git a/client/src/img/categories/history.jpg b/client/src/img/categories/history.jpg new file mode 100755 index 0000000..a0a4a2c Binary files /dev/null and b/client/src/img/categories/history.jpg differ diff --git a/client/src/img/categories/imagesets.jpg b/client/src/img/categories/imagesets.jpg new file mode 100755 index 0000000..4e7f594 Binary files /dev/null and b/client/src/img/categories/imagesets.jpg differ diff --git a/client/src/img/categories/language.jpg b/client/src/img/categories/language.jpg new file mode 100755 index 0000000..f615d88 Binary files /dev/null and b/client/src/img/categories/language.jpg differ diff --git a/client/src/img/categories/law.jpg b/client/src/img/categories/law.jpg new file mode 100755 index 0000000..72c6cec Binary files /dev/null and b/client/src/img/categories/law.jpg differ diff --git a/client/src/img/categories/mathematics.jpg b/client/src/img/categories/mathematics.jpg new file mode 100755 index 0000000..b421285 Binary files /dev/null and b/client/src/img/categories/mathematics.jpg differ diff --git a/client/src/img/categories/medicine.jpg b/client/src/img/categories/medicine.jpg new file mode 100755 index 0000000..43870de Binary files /dev/null and b/client/src/img/categories/medicine.jpg differ diff --git a/client/src/img/categories/other.jpg b/client/src/img/categories/other.jpg new file mode 100755 index 0000000..ec4d6d3 Binary files /dev/null and b/client/src/img/categories/other.jpg differ diff --git a/client/src/img/categories/performingarts.jpg b/client/src/img/categories/performingarts.jpg new file mode 100755 index 0000000..bf60fd2 Binary files /dev/null and b/client/src/img/categories/performingarts.jpg differ diff --git a/client/src/img/categories/philosophy.jpg b/client/src/img/categories/philosophy.jpg new file mode 100755 index 0000000..90589f9 Binary files /dev/null and b/client/src/img/categories/philosophy.jpg differ diff --git a/client/src/img/categories/physics.jpg b/client/src/img/categories/physics.jpg new file mode 100755 index 0000000..d24d210 Binary files /dev/null and b/client/src/img/categories/physics.jpg differ diff --git a/client/src/img/categories/politics.jpg b/client/src/img/categories/politics.jpg new file mode 100755 index 0000000..453b0ee Binary files /dev/null and b/client/src/img/categories/politics.jpg differ diff --git a/client/src/img/categories/psychology.jpg b/client/src/img/categories/psychology.jpg new file mode 100755 index 0000000..4116513 Binary files /dev/null and b/client/src/img/categories/psychology.jpg differ diff --git a/client/src/img/categories/sociology.jpg b/client/src/img/categories/sociology.jpg new file mode 100755 index 0000000..91eb30d Binary files /dev/null and b/client/src/img/categories/sociology.jpg differ diff --git a/client/src/img/categories/sports.jpg b/client/src/img/categories/sports.jpg new file mode 100755 index 0000000..3846f30 Binary files /dev/null and b/client/src/img/categories/sports.jpg differ diff --git a/client/src/img/categories/theology.jpg b/client/src/img/categories/theology.jpg new file mode 100755 index 0000000..5de3a55 Binary files /dev/null and b/client/src/img/categories/theology.jpg differ diff --git a/client/src/img/categories/transport.jpg b/client/src/img/categories/transport.jpg new file mode 100755 index 0000000..c8b0f67 Binary files /dev/null and b/client/src/img/categories/transport.jpg differ diff --git a/client/src/img/categories/urbanplanning.jpg b/client/src/img/categories/urbanplanning.jpg new file mode 100755 index 0000000..ea9fb83 Binary files /dev/null and b/client/src/img/categories/urbanplanning.jpg differ diff --git a/client/src/img/categories/visualart.jpg b/client/src/img/categories/visualart.jpg new file mode 100755 index 0000000..9264132 Binary files /dev/null and b/client/src/img/categories/visualart.jpg differ