Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed inline styling #744

Merged
merged 10 commits into from
Nov 8, 2020
Merged

Removed inline styling #744

merged 10 commits into from
Nov 8, 2020

Conversation

K-Kumar-01
Copy link
Contributor

@K-Kumar-01 K-Kumar-01 commented Oct 23, 2020

Changed the styling by material ui box component
Some changes made using styled components

Some functionalities like cursor:pointer and backgroundImage are not available as JSX attributes . So had to use styled component there.
Rest all has been done using material ui box
The issue link is here

Changed the styling by material ui box component
Some changes made using styled components
Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @K-Kumar-01 ! It's good to see you around here again! Thanks for this new PR, it looks much better than the first one. I'm sorry I failed to explicit that we DO use double quotes for element attributes, so in places like <Box clone justifyContent='flex-start' alignItems='center'> these should actually be double quotes! Please update your PR with the changes requested so we can accept it!

@@ -32,9 +33,9 @@ class AttributionDialog extends React.Component {
</DialogTitle>
<DialogContent>
<Message message={this.props.message} />
<div style={{ marginBottom: units(2), marginTop: units(2) }}>
<Box my={units(2)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it my={2} instead of my={units(2)}

<UserAvatars users={byPictures} />
<span style={{ lineHeight: '24px', paddingLeft: units(1), paddingRight: units(1) }}>
<Box component='span' lineHeight='24px' px={units(1)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the units() call around 1. Make it px={1} instead.

@@ -209,21 +210,22 @@ class EditTaskDialog extends React.Component {
const canRemove = this.state.options.length > 2;

return (
<div style={{ marginTop: units(2) }}>
<Box mt={units(2)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it mt={2}. In general, remove all units() calls when using Box.

disabled={item.other}
style={{ padding: `${units(0.5)} ${units(1)}`, width: '75%' }}
/>
<Box clone p={`${units(0.5)} ${units(1)}`} width={"75%"}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove units call

@@ -236,7 +238,7 @@ class EditTaskDialog extends React.Component {
</Row>
</div>
))}
<div style={{ marginTop: units(1) }}>
<Box mt={units(2)} >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove units call. Make it mt={2} instead.

@@ -331,9 +332,9 @@ class GeolocationRespondTask extends Component {
onBlur={() => this.setState({ openResultsPopup: false })}
fullWidth
/>
<div style={{ font: caption, color: black54 }}>
<Box color={black54} fontFamily={fontStackSans} fontWeight={400} fontSize={units(1.5)} lineHeight={units(2.5)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. This is better handled with the material-ui Typography component.

import Dialog from '@material-ui/core/Dialog';
import DialogContent from '@material-ui/core/DialogContent';
import { Map, Marker, TileLayer } from 'react-leaflet';
import styled from 'styled-components';
import config from 'config'; // eslint-disable-line require-path-exists/exists
import ParsedText from '../ParsedText';
import { safelyParseJSON } from '../../helpers';
import { units, black05, black38, FlexRow } from '../../styles/js/shared';
import { units, black05, black38, FlexRow, black54 } from '../../styles/js/shared';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is black54 being imported for?

<UserAvatars users={byPictures} />
<span style={{ lineHeight: '24px', paddingLeft: units(1), paddingRight: units(1) }}>
<Box component='span' lineHeight='24px' px={units(1)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove units() call. I think you got the idea already!

Added double quotes in attrbutes instead of single
Removed the units function wherever necessary
@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim
I have made the requested changes in the new PR.
Tell me if there is any further change needed.

Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @K-Kumar-01 ! Thanks for your changes. We're almost there. There are still some changes needed to comply with coding guidelines. I'm pasting the eslint output to make it easier to detect what needs to change. Please fix those so we can accept and merge it! Thanks a lot!

ref={(m) => { this.marker = m; }}
/>
</Map>
<Box height={'400px'}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height="400px"

375:23 error Curly braces are unnecessary here react/jsx-curly-brace-presence

@@ -371,23 +372,24 @@ class GeolocationRespondTask extends Component {
margin="normal"
/>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this div as the newly added Box should take its place.

@@ -236,7 +238,7 @@ class EditTaskDialog extends React.Component {
</Row>
</div>
))}
<div style={{ marginTop: units(1) }}>
<Box mt={2} >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mt={1}

<Box clone mb={2}>
<FlexRow >
<Box clone flex={10} >
<Box clone justifyContent='flex-start' alignItems='center'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

214:41 error Unexpected usage of singlequote jsx-quotes
214:65 error Unexpected usage of singlequote jsx-quotes

<Autocomplete
className="task__datetime-timezone"
options={
taskTimezones && taskTimezones.length ? taskTimezones : Object.values(timezones)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

246:1 error Line 246 exceeds the maximum line length of 100 max-len

{ team.team_bot_installations.edges.map((installation) => {
const bot = installation.node.team_bot;
const botExpanded = this.state.expanded === bot.dbid;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

203:1 error Trailing spaces not allowed no-trailing-spaces

Comment on lines 22 to 26
import styled from 'styled-components';

const StyledTeamAvatar = styled(TeamAvatar)`
background-image: url('${(props) => props.imageUrl}');
`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. Using styled-components is not in the scope of this ticket.

Comment on lines 145 to 151
<TeamAvatar
style={{ backgroundImage: `url(${avatarPreview || team.avatar})` }}
<StyledTeamAvatar
imageUrl={avatarPreview || team.avatar}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. Using styled-components is not in the scope of this ticket.

>
<CancelIcon />
</StyledIconButton>
</Row>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

305:23 error Trailing spaces not allowed no-trailing-spaces

/>
))}
</List>
</Card>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

90:22 error Trailing spaces not allowed no-trailing-spaces

@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim
I will fix these changes ASAP

Reverted the styled components
Removed the trailing spaces
@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim
I have made the requested changes along with reverting of styled components made by me back to original form.
Please let me know if there is any change needed

Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! There are still some trailing spaces. Looks like you created those when fixing the other issues.

@@ -53,9 +54,11 @@ class GeolocationTaskResponse extends Component {
<FlexRow className="task__geolocation-response">
<span className="task__response"><ParsedText text={name} /></span>
{coordinatesString ?
<span
<Box
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

57:15 error Trailing spaces not allowed no-trailing-spaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ This is still unfixed

Comment on lines 168 to 170
<Box
display="flex"
justifyContent="flex-start"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

168:17 error Trailing spaces not allowed no-trailing-spaces
169:29 error Trailing spaces not allowed no-trailing-spaces
170:42 error Trailing spaces not allowed no-trailing-spaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ These are still unfixed

@amoedoamorim
Copy link
Contributor

Please update your branch with latest develop and watch out for conflicts: src/app/components/user/AttributionDialog.js

@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim
I have updated my develop branch with the latest code from original. Let me if there are any changes required.

Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @K-Kumar-01 ! There are still some trailing spaces left! Please fix those and we should be in a good position to merge! Thank you so much for your effort in contributing! We appreciate it!

@@ -53,9 +54,11 @@ class GeolocationTaskResponse extends Component {
<FlexRow className="task__geolocation-response">
<span className="task__response"><ParsedText text={name} /></span>
{coordinatesString ?
<span
<Box
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ This is still unfixed

Comment on lines 168 to 170
<Box
display="flex"
justifyContent="flex-start"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ These are still unfixed

@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim I have removed the trailing spaces which were left
Let me if there is any change required.

Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @K-Kumar-01 , thanks again! I notices a couple details left that are blocking the build. Please fix those so we can move on! Thank you!

@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import Box from '@material-ui/core/Box'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3:40 error Missing semicolon semi

<a href={fileUploadPath} target="_blank" rel="noreferrer noopener" style={{ color: checkBlue }}>{response}</a>
</p>
<Box component="p" textAlign="center">
<Box
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

418:19 error Trailing spaces not allowed no-trailing-spaces

@K-Kumar-01
Copy link
Contributor Author

@amoedoamorim Made the requested changes that were causing build error

@amoedoamorim
Copy link
Contributor

Thanks @K-Kumar-01 and congrat's on your approved PR! That looks amazing now, I'll go ahead and merge it! Thank you so much for the effort you put in your contribution! We appreciate it!

@amoedoamorim amoedoamorim merged commit d952e3e into meedan:develop Nov 8, 2020
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