mirror of
				https://github.com/mastermindzh/rickvanlieshout.com
				synced 2025-10-31 08:40:27 +01:00 
			
		
		
		
	Upgrade to Gatsby v2
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/components/Post/Meta/Meta.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/components/Post/Meta/Meta.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| import React from 'react'; | ||||
| import moment from 'moment'; | ||||
| import styles from './Meta.module.scss'; | ||||
|  | ||||
| const Meta = ({ date }) => ( | ||||
|   <div className={styles['meta']}> | ||||
|     <p className={styles['meta__date']}>Published {moment(date).format('D MMM YYYY')}</p> | ||||
|   </div> | ||||
| ); | ||||
|  | ||||
| export default Meta; | ||||
							
								
								
									
										9
									
								
								src/components/Post/Meta/Meta.module.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/components/Post/Meta/Meta.module.scss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| @import '../../../assets/scss/variables'; | ||||
| @import '../../../assets/scss/mixins'; | ||||
|  | ||||
| .meta { | ||||
|   &__date { | ||||
|     font-style: italic; | ||||
|   } | ||||
|  | ||||
| } | ||||
							
								
								
									
										14
									
								
								src/components/Post/Meta/Meta.test.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/components/Post/Meta/Meta.test.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| import React from 'react'; | ||||
| import renderer from 'react-test-renderer'; | ||||
| import Meta from './Meta'; | ||||
|  | ||||
| describe('Meta', () => { | ||||
|   it('renders correctly', () => { | ||||
|     const props = { | ||||
|       date: '2016-09-01T23:46:37.121Z' | ||||
|     }; | ||||
|  | ||||
|     const tree = renderer.create(<Meta {...props} />).toJSON(); | ||||
|     expect(tree).toMatchSnapshot(); | ||||
|   }); | ||||
| }); | ||||
							
								
								
									
										14
									
								
								src/components/Post/Meta/__snapshots__/Meta.test.js.snap
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/components/Post/Meta/__snapshots__/Meta.test.js.snap
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||||
|  | ||||
| exports[`Meta renders correctly 1`] = ` | ||||
| <div | ||||
|   className="meta" | ||||
| > | ||||
|   <p | ||||
|     className="meta__date" | ||||
|   > | ||||
|     Published  | ||||
|     2 Sep 2016 | ||||
|   </p> | ||||
| </div> | ||||
| `; | ||||
							
								
								
									
										1
									
								
								src/components/Post/Meta/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/components/Post/Meta/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| export { default } from './Meta'; | ||||
		Reference in New Issue
	
	Block a user