Open kwokwilliam opened 5 years ago
I am having troubles resizing images to fit within the given width. Also, I am not sure if the parent components I used are correct.
Commented on parts of your commit (2ca12ed) I can try to integrate it into a test page and check out what the specific problem with Resizing is.
Great work so far, I made some changes in a recent commit. I will comment on them in the commit. https://github.com/uwigem/uwigem.com/commit/10c6a0fb9305091453d9857918c55e4421e29bc5
Next steps are to add comments detailing the class inputs and outputs, expectations etc as well as decide if you want to use flexbox classes instead (may be more performant in the end, I can clarify this if you would like to know why).
The main component will be called
SideBySideContent
. It is located incomponents/SideBySideContent/SideBySideContent.js
This component will receive three props:
leftChild
,rightChild
, andleftWidth
.leftChild
andrightChild
will always be a single React component. We can enforce this later on with proptypes.leftWidth
will be the width of the left child. The right child's width will fill up the rest up to 100%.leftChild
andrightChild
can be interchanged instead withprops.children[0]
andprops.children[1]
if you would prefer to do it that way.