I need to create a component that will handle the styles(height, width, position) and props(src and url) for future purposes, so it has some default styles of the images so that they can can be used few times later on.
I will se styled components for the styles, but i need some help with the components itself.
So far I have props for size src and alt. My question is how the below component handle the image upload? where to put the image url for the future? Will it be enough If I put the image url(I will be using url not separate folder with images) between image divs?
import { oneOf } from "prop-types"
import * as Styled from "./Image.styled"
const Image = ({ size, src, url}) => (
<Styled.Image>
<image>
</image>
</Styled.Image>
)
Image.propTypes = {
size: oneOf(["small", "medium", "large"]),
}
Image.defaultProps = {
size: "medium",
}
export default Image