Skip to content

Conversation

@rhourani
Copy link

…ying to install apollo provider)

@tro9999 @valto
Testimonial component Story (for code review only, Have a bug when trying to install apollo provider)

…ying to install apollo provider)

Testimonial component Story (for code review only, Have a bug when trying to install apollo provider)
@valto valto requested a review from tro9999 July 23, 2021 12:05
@tro9999
Copy link
Collaborator

tro9999 commented Jul 26, 2021

Very little to review... no environment to install.
Only this file is relevant packages/testimonial/src/components/ReviewCard/ReviewCard.js and it has only few lines of code. Anyway I see, that styles are used wrong way. Don't use inline styles or style files(css) instead use styled-components method.

@rhourani
Copy link
Author

rhourani commented Jul 26, 2021

Thanks for the feedback @tro9999 , Maybe you meant by "no environment to install" that the project could not work when you tried to run it on your machine?

Yes true, there is Apollo client provider that it is responsible of fetching data from the API which I could not install on this project when made it a monrepo/packages.


Regarding the styled-components; From what I understand from the available resources, Chakra-UI and styled-components are style engines which conflicts with each other when be used together. And actually this is what happened when I tried to give a chakra ui component a style using styled-components library.

This is an example about what I mean:

I import a {Box} from /@chakra-ui

using it in my code:

Now to give styles for it using styled-components library, I should do somethng like this:

const Box = styled.div ' Some styles' // This wont work because Box is used above in the import

or

const BoxStyle = styled.Box 'Some styles' // this to attach to another style variable as you know - For sure it is wrong, I am attaching a const to something I import, not to a style variable

So in the end I settled on using the approach of the styled-components itself, and giving the desired style in a style={variableName} syntax. (But this considered as an inline-css)

Can you show me an example please? or if you are available at some time we would arrrange a meeting, and I can show what I did on my local project.

rhourani added 2 commits July 28, 2021 21:02
Added apollo/client, the project works and can be installed now and work fine
For this component there was no need to use the styled-components because I have used the chakra UI component only. Not other react components.
@rhourani
Copy link
Author

@tro9999 @valto , I have fixed the bug of project not installable, added missed lib globally (apollo client provider).

Regrading styled-components, I have checked my work and other pull requests here, And my work is correct according with the examples here. In this component there is no need for styled-components since all the components I have used are coming from chakra UI library.

There is one question now still with no answer. Is it possible to link chromatic with monorepo to all exist packages?

BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants