check icon indicating copy to clipboard operation
check copied to clipboard

Remove inline styling in favor of material-ui Box component

Open amoedoamorim opened this issue 4 years ago • 24 comments

Tell us about your request Remove inline styling in favor of material-ui Box component

Which service(s) is this request for? Let us know which services(s) you want this for?

  • Check Web
  • Check Mark

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? In order to achieve a better code organization, we're shifting away from inline styling. Also, by using material-ui's css-in-js solution we benefit from the rtl layout handling. When styling for spacing such as margins and paddings, it makes sense to use the Box component.

Sample code locations (not limited to): https://github.com/meedan/check-web/blob/develop/src/app/components/source/UserSecurity.js#L479 https://github.com/meedan/check-web/blob/develop/src/app/components/tag/TagInput.js#L98 https://github.com/meedan/check-web/blob/develop/src/app/components/team/TeamTasks.js

Additional context To know more about React Box component: https://material-ui.com/components/box/

amoedoamorim avatar Oct 01 '20 00:10 amoedoamorim

Want to work on it.

sparkingdark avatar Oct 02 '20 02:10 sparkingdark

Is this issue taken? Or can i work on it too ?

ghost avatar Oct 02 '20 11:10 ghost

@amoedoamorim I would like to work on this issue! Please assign this to me! Any of the two Check Web or Check Mark will work for me!

Hard-Coder05 avatar Oct 02 '20 11:10 Hard-Coder05

@KarenEfereyan I have assigned it to you! Thanks for your interest. Please go ahead and let us know if you have any trouble.

amoedoamorim avatar Oct 02 '20 13:10 amoedoamorim

@Hard-Coder05 Thank you for your interest! I assigned this issue to @KarenEfereyan but it doesn't mean you cannot submit meaningful contributions too. You can browse the code for similar patterns and fixes.

amoedoamorim avatar Oct 02 '20 13:10 amoedoamorim

Hey @KarenEfereyan are you still working on this?

abhisheknaiidu avatar Oct 04 '20 06:10 abhisheknaiidu

@abhisheknaiidu please go on

ghost avatar Oct 04 '20 09:10 ghost

Can I take up this issue?

aloks98 avatar Oct 05 '20 07:10 aloks98

@amoedoamorim Can I work on this issue? I guess @KarenEfereyan is not working on it!

Hard-Coder05 avatar Oct 08 '20 06:10 Hard-Coder05

@abhisheknaiidu was supposed to work on it as I gave him the go ahead to. As you can see in my comment above. So ask him and if he's not I guess you can work on it.

ghost avatar Oct 08 '20 06:10 ghost

@KarenEfereyan Okay cool! Then @amoedoamorim Please assign me this issue!

Hard-Coder05 avatar Oct 08 '20 06:10 Hard-Coder05

Is the issue still open. I would like to work on it @KarenEfereyan and @amoedoamorim

K-Kumar-01 avatar Oct 16 '20 08:10 K-Kumar-01

Hello everyone! Thank you all for your interest in contributing! Please feel free to submit your PRs regardless of being assigned to the ticket!

amoedoamorim avatar Oct 16 '20 12:10 amoedoamorim

Hello @amoedoamorim I installed Docker compoese(docker not installed). Then when i try to run sudo git clone --recursive [email protected]:meedan/check.git && cd check it shows : The authenticity of host 'github.com (13.234.210.38)' can't be established. On clicking yes, it says Permission denied (publickey). Could you tell me how to fix this

K-Kumar-01 avatar Oct 19 '20 17:10 K-Kumar-01

Hey @K-Kumar-01, please try this and let me know if this works for you:

https://github.com/ome/devspace/issues/38#issuecomment-211515244

amoedoamorim avatar Oct 19 '20 18:10 amoedoamorim

Hello @amoedoamorim
So i went where i want to clone the repo Entered the following command ssh-keyscan github.com >> ~/.ssh/known_hosts Then tried sudo git clone --recursive [email protected]:meedan/check.git && cd check. Still it shows

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

K-Kumar-01 avatar Oct 19 '20 18:10 K-Kumar-01

@amoedoamorim Can't we simply clone the this [repo] (https://github.com/meedan/check-web/tree/ca90b5da133801388acb33eaa6d1464047551a95) and perform do the operations here. Is there any way without installing the full check repo and only doing the submodule installation .

Also i tried creating using styled components in codesandbox the replica of inline styling which was done Here

Can we do in this way or should i use another technique.

The replica was of of line 125

K-Kumar-01 avatar Oct 19 '20 18:10 K-Kumar-01

@amoedoamorim,

Just created a PR for that removes inline styling for 50 files in the check-web repo. Another ~50 files still have inline styling within the check-web project for anyone else to pick up (as well as changes needed in the check-mark repo).

CC: @K-Kumar-01

jmakhack avatar Oct 20 '20 03:10 jmakhack

@jmakhack I tried using the code

<div className="App" style={{width:"80%", margin:'0 auto'}}>
      <div style={{ display: "flex" }}>
        <div style={{ width: "50%" }}>
          <CardContainer>
            <Box clone p={0} pt={2} textAlign="center">
              <CardHeader
                // style={{ padding: 0, paddingTop: "16px" }}
                title={"Hello world"}
                subheader={true ? "Hello" : null}
              />
            </Box>
            <p>{"lorem iosunaf sm ajsbfajs fkjasn"}</p>
          </CardContainer>
        </div>
        <div style={{ width: "50%" }}>
          <CardContainer>
            <CardHeader
              style={{ padding: 0, paddingTop: "16px", textAlign:"center" }}
              title={"Hello world"}
              subheader={true ? "Hello" : null}
            />
            <p>{"lorem iosunaf sm ajsbfajs fkjasn"}</p>
          </CardContainer>
        </div>
      </div>
    </div>

but for this the padding was not removed as done when we did inline styling. Could you please tell me about this

K-Kumar-01 avatar Oct 20 '20 11:10 K-Kumar-01

@amoedoamorim I created a PR where i changed the inline styling to styled components or box components for 26 files. Please let me know if there is any change needed.

K-Kumar-01 avatar Oct 21 '20 06:10 K-Kumar-01

@amoedoamorim Any updates on this

K-Kumar-01 avatar Oct 22 '20 19:10 K-Kumar-01

@amoedoamorim I created a new PR with some changes in code. Please let me know if there are any changes required. Link is here

K-Kumar-01 avatar Oct 23 '20 17:10 K-Kumar-01

@amoedoamorim Any updates on the PR I made?

K-Kumar-01 avatar Oct 26 '20 07:10 K-Kumar-01

If this is not resolved yet, i will like to work on it

herbdullah avatar Oct 26 '20 12:10 herbdullah