From 9d10aa635be1caeb4c8fe13a31c3d1d272836615 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Thu, 2 Jun 2016 13:21:31 -0400 Subject: [PATCH] Add index.js to folders --- src/components/anchors.js | 24 ++---------------------- src/components/category.js | 2 +- src/components/index.js | 6 ++++++ src/components/picker.js | 7 ++----- src/components/preview.js | 2 +- src/index.js | 8 ++++---- src/svgs/index.js | 9 +++++++++ 7 files changed, 25 insertions(+), 33 deletions(-) create mode 100644 src/components/index.js create mode 100644 src/svgs/index.js diff --git a/src/components/anchors.js b/src/components/anchors.js index 0843cbd..6afddff 100644 --- a/src/components/anchors.js +++ b/src/components/anchors.js @@ -1,27 +1,7 @@ import React from 'react' import InlineSVG from 'svg-inline-react' -import Activity from '../svgs/activity.svg' -import Flags from '../svgs/flags.svg' -import Foods from '../svgs/foods.svg' -import Nature from '../svgs/nature.svg' -import Objects from '../svgs/objects.svg' -import People from '../svgs/people.svg' -import Places from '../svgs/places.svg' -import Recent from '../svgs/recent.svg' -import Symbols from '../svgs/symbols.svg' - -var svgs = { - Activity, - Flags, - Foods, - Nature, - Objects, - People, - Places, - Recent, - Symbols, -} +import * as SVGs from '../svgs' export default class Anchors extends React.Component { constructor(props) { @@ -41,7 +21,7 @@ export default class Anchors extends React.Component { var { name } = category return - + })} diff --git a/src/components/category.js b/src/components/category.js index b062a8a..d8edaa2 100644 --- a/src/components/category.js +++ b/src/components/category.js @@ -1,5 +1,5 @@ import React from 'react' -import Emoji from './emoji' +import {Emoji} from '.' export default class Category extends React.Component { componentDidMount() { diff --git a/src/components/index.js b/src/components/index.js new file mode 100644 index 0000000..70bb628 --- /dev/null +++ b/src/components/index.js @@ -0,0 +1,6 @@ +export {default as Anchors} from './anchors' +export {default as Category} from './category' +export {default as Emoji} from './emoji' +export {default as Picker} from './picker' +export {default as Preview} from './preview' +export {default as Search} from './search' diff --git a/src/components/picker.js b/src/components/picker.js index e81a04d..e362e7b 100644 --- a/src/components/picker.js +++ b/src/components/picker.js @@ -1,12 +1,9 @@ import '../utils/raf-polyfill' import React from 'react' - import data from '../../data' -import Preview from './preview' -import Category from './category' -import Search from './search' -import Anchors from './anchors' + +import {Anchors, Category, Preview, Search} from '.' const DEFAULT_CATEGORIES = [ { name: 'Recent', emojis: null } diff --git a/src/components/preview.js b/src/components/preview.js index f6c31f1..04f6e9f 100644 --- a/src/components/preview.js +++ b/src/components/preview.js @@ -1,5 +1,5 @@ import React from 'react' -import Emoji from './emoji' +import {Emoji} from '.' export default class Preview extends React.Component { constructor(props) { diff --git a/src/index.js b/src/index.js index 7ca4e62..596ac6b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -export {default as Category} from './components/category' -export {default as Emoji} from './components/emoji' -export {default as Picker} from './components/picker' -export {default as Preview} from './components/preview' +export { + Picker, + Emoji, +} from './components' diff --git a/src/svgs/index.js b/src/svgs/index.js new file mode 100644 index 0000000..009f2eb --- /dev/null +++ b/src/svgs/index.js @@ -0,0 +1,9 @@ +export {default as Activity} from './activity.svg' +export {default as Flags} from './flags.svg' +export {default as Foods} from './foods.svg' +export {default as Nature} from './nature.svg' +export {default as Objects} from './objects.svg' +export {default as People} from './people.svg' +export {default as Places} from './places.svg' +export {default as Recent} from './recent.svg' +export {default as Symbols} from './symbols.svg'