From 9126341164d17bb378ebb6f4488a470877ca622e Mon Sep 17 00:00:00 2001 From: Neil Coetzer Date: Fri, 6 Oct 2023 16:49:36 +0200 Subject: [PATCH] Refactored child components into their own sub directory for easier import --- components/image/{ => child-components}/figure.js | 4 ++-- components/image/child-components/index.js | 5 +++++ components/image/{ => child-components}/inline-controls.js | 0 components/image/{ => child-components}/media.js | 0 components/image/index.js | 5 +---- 5 files changed, 8 insertions(+), 6 deletions(-) rename components/image/{ => child-components}/figure.js (77%) create mode 100644 components/image/child-components/index.js rename components/image/{ => child-components}/inline-controls.js (100%) rename components/image/{ => child-components}/media.js (100%) diff --git a/components/image/figure.js b/components/image/child-components/figure.js similarity index 77% rename from components/image/figure.js rename to components/image/child-components/figure.js index e60c68a7..f965738e 100644 --- a/components/image/figure.js +++ b/components/image/child-components/figure.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; -import { StyledComponentContext } from '../styled-components-context'; -import { InlineControlsStyleWrapper } from './styles'; +import { StyledComponentContext } from '../../styled-components-context'; +import { InlineControlsStyleWrapper } from '../styles'; export const Figure = (props) => { const { style, children, ...rest } = props; diff --git a/components/image/child-components/index.js b/components/image/child-components/index.js new file mode 100644 index 00000000..3e05dd96 --- /dev/null +++ b/components/image/child-components/index.js @@ -0,0 +1,5 @@ +import { Media, ImageContext } from './media'; +import { Figure } from './figure'; +import { InlineControls } from './inline-controls'; + +export { Media, ImageContext, Figure, InlineControls }; diff --git a/components/image/inline-controls.js b/components/image/child-components/inline-controls.js similarity index 100% rename from components/image/inline-controls.js rename to components/image/child-components/inline-controls.js diff --git a/components/image/media.js b/components/image/child-components/media.js similarity index 100% rename from components/image/media.js rename to components/image/child-components/media.js diff --git a/components/image/index.js b/components/image/index.js index 4f72c280..78b78cb2 100644 --- a/components/image/index.js +++ b/components/image/index.js @@ -5,10 +5,7 @@ import PropTypes from 'prop-types'; /** * Internal Dependencies */ - -import { Media, ImageContext } from './media'; -import { Figure } from './figure'; -import { InlineControls } from './inline-controls'; +import { Media, ImageContext, Figure, InlineControls } from './child-components'; import { useMedia } from '../../hooks/use-media'; const ImageWrapper = (props) => {