Skip to content

Commit

Permalink
refactor(components): update components architecture (#3248)
Browse files Browse the repository at this point in the history
This moves all components to their own folder for consistency.
  • Loading branch information
francoischalifour authored Oct 31, 2018
1 parent f7b3803 commit 2a416f8
Show file tree
Hide file tree
Showing 23 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'preact-compat';
import cx from 'classnames';
import PropTypes from 'prop-types';
import Template from '../Template.js';
import Template from '../Template/Template';

const renderLink = ({ cssClasses, createURL, refine, templateProps }) => (
item,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ClearRefinements/ClearRefinements.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import cx from 'classnames';
import Template from '../Template.js';
import Template from '../Template/Template';

const ClearRefinements = ({
hasRefinements,
Expand Down
2 changes: 1 addition & 1 deletion src/components/GeoSearchControls/GeoSearchControls.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import cx from 'classnames';
import Template from '../Template';
import Template from '../Template/Template';
import GeoSearchButton from './GeoSearchButton';
import GeoSearchToggle from './GeoSearchToggle';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Hits/Hits.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import cx from 'classnames';
import Template from '../Template.js';
import Template from '../Template/Template';

const Hits = ({ results, hits, cssClasses, templateProps }) => {
if (results.hits.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hits/__tests__/Hits-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { shallow, mount } from 'enzyme';
import Hits from '../Hits';
import Template from '../../Template';
import Template from '../../Template/Template';
import { highlight } from '../../../helpers';

describe('Hits', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfiniteHits/InfiniteHits.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import cx from 'classnames';
import Template from '../Template.js';
import Template from '../Template/Template';

const InfiniteHits = ({
results,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { Component } from 'preact-compat';
import PropTypes from 'prop-types';
import cx from 'classnames';

import Template from './Template';
import Template from '../Template/Template';

class MenuSelect extends Component {
static propTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import MenuSelect from '../MenuSelect';
import { mount } from 'enzyme';

import defaultTemplates from '../../widgets/menu-select/defaultTemplates';
import defaultTemplates from '../../../widgets/menu-select/defaultTemplates';

describe('MenuSelect', () => {
const cssClasses = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/RefinementList/RefinementList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import cx from 'classnames';
import isEqual from 'lodash/isEqual';
import { isSpecialClick } from '../../lib/utils.js';
import Template from '../Template.js';
import Template from '../Template/Template';
import RefinementListItem from './RefinementListItem.js';
import SearchBox from '../SearchBox';

Expand Down
2 changes: 1 addition & 1 deletion src/components/RefinementList/RefinementListItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'preact-compat';
import isEqual from 'lodash/isEqual';
import Template from '../Template.js';
import Template from '../Template/Template';

class RefinementListItem extends Component {
componentWillMount() {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Stats/Stats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import Template from '../Template.js';
import Template from '../Template/Template';

const Stats = ({
nbHits,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'preact-compat';
import PropTypes from 'prop-types';
import isEqual from 'lodash/isEqual';
import { isReactElement, renderTemplate } from '../lib/utils';
import { isReactElement, renderTemplate } from '../../lib/utils';

class Template extends Component {
shouldComponentUpdate(nextProps) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'preact-compat';
import PropTypes from 'prop-types';
import Template from './Template.js';
import Template from '../Template/Template';

const ToggleRefinement = ({
currentRefinement,
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/hits-per-page/hits-per-page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { render, unmountComponentAtNode } from 'preact-compat';
import cx from 'classnames';
import find from 'lodash/find';
import Selector from '../../components/Selector.js';
import Selector from '../../components/Selector/Selector.js';
import connectHitsPerPage from '../../connectors/hits-per-page/connectHitsPerPage.js';
import { getContainerNode } from '../../lib/utils.js';
import { component } from '../../lib/suit.js';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/menu-select/menu-select.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { render } from 'preact-compat';
import cx from 'classnames';
import connectMenu from '../../connectors/menu/connectMenu';
import MenuSelect from '../../components/MenuSelect';
import MenuSelect from '../../components/MenuSelect/MenuSelect';
import defaultTemplates from './defaultTemplates';
import { prepareTemplateProps, getContainerNode } from '../../lib/utils';
import { component } from '../../lib/suit';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/sort-by/sort-by.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { render, unmountComponentAtNode } from 'preact-compat';
import cx from 'classnames';
import Selector from '../../components/Selector.js';
import Selector from '../../components/Selector/Selector.js';
import connectSortBy from '../../connectors/sort-by/connectSortBy.js';
import { getContainerNode } from '../../lib/utils.js';
import { component } from '../../lib/suit.js';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/toggleRefinement/toggleRefinement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { render, unmountComponentAtNode } from 'preact-compat';
import cx from 'classnames';
import ToggleRefinement from '../../components/ToggleRefinement.js';
import ToggleRefinement from '../../components/ToggleRefinement/ToggleRefinement.js';
import connectToggleRefinement from '../../connectors/toggleRefinement/connectToggleRefinement.js';
import defaultTemplates from './defaultTemplates.js';
import { getContainerNode, prepareTemplateProps } from '../../lib/utils.js';
Expand Down

0 comments on commit 2a416f8

Please sign in to comment.