This repository was archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy paththumbnail.js
More file actions
52 lines (43 loc) · 1.27 KB
/
thumbnail.js
File metadata and controls
52 lines (43 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react';
import { GeneralPropTypes, FlexboxPropTypes, createClassName, generalClassNames, removeProps, objectKeys } from '../utils';
/**
* Thumbnail component.
* http://foundation.zurb.com/sites/docs/switch.html
*
* @param {Object} props
* @returns {Object}
*/
export const Thumbnail = (props) => {
const className = createClassName(
props.noDefaultClassName ? null : 'thumbnail',
props.className,
generalClassNames(props)
);
const passProps = removeProps(props, objectKeys(Thumbnail.propTypes));
return <img {...passProps} className={className}/>;
};
Thumbnail.propTypes = {
...GeneralPropTypes,
...FlexboxPropTypes
};
/**
* Thumbnail link component.
* http://foundation.zurb.com/sites/docs/switch.html
*
* @param {Object} props
* @returns {Object}
*/
export const ThumbnailLink = (props) => {
const className = createClassName(
props.noDefaultClassName ? null : 'thumbnail',
props.className,
generalClassNames(props)
);
// TODO: Consider improving how properties are set for both the link and image.
const passProps = removeProps(props, objectKeys(ThumbnailLink.propTypes));
return <a className={className}><img {...passProps}/></a>;
};
ThumbnailLink.propTypes = {
...GeneralPropTypes,
...FlexboxPropTypes
};