Skip to content

Commit

Permalink
feat(AsyncContent): initial
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Oct 30, 2018
1 parent 90784bd commit e126561
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/molecules/AsyncContent/AsyncContent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { Loader } from '../../atoms/Loader';

const AsyncContent = ({ loading, children, ...props }) => {
if (loading) {
return <Loader { ...props } />;
}

return children;
};

export { AsyncContent };
1 change: 1 addition & 0 deletions src/molecules/AsyncContent/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { AsyncContent } from './AsyncContent';
1 change: 1 addition & 0 deletions src/molecules/molecules.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
export { Rating } from './Rating';
export { ButtonGroup } from './ButtonGroup';
export { Menu } from './Menu';
export { AsyncContent } from './AsyncContent';

0 comments on commit e126561

Please sign in to comment.