Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
fix: some warnings in console (#155)
Browse files Browse the repository at this point in the history
* fix: remove react emotion selector warning

* fix: validate DOM nesting
  • Loading branch information
antoinechalifour authored and juanpicado committed Oct 4, 2019
1 parent 7bd9eb7 commit 583ddd5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
14 changes: 9 additions & 5 deletions src/components/DetailSidebar/DetailSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ import Repository from '../Repository/Repository';

import { DetailContext } from '../../pages/Version';

import { TitleListItem, TitleListItemText } from './styles';
import { TitleListItem, TitleListItemText, PackageDescription, PackageVersion } from './styles';

const renderLatestDescription = (description, version, isLatest: boolean = true): JSX.Element => {
return (
<span>
<div>{description}</div>
{version ? <small>{`${isLatest ? 'Latest v' : 'v'}${version}`}</small> : null}
</span>
<>
<PackageDescription>{description}</PackageDescription>
{version ? (
<PackageVersion>
<small>{`${isLatest ? 'Latest v' : 'v'}${version}`}</small>
</PackageVersion>
) : null}
</>
);
};

Expand Down
15 changes: 8 additions & 7 deletions src/components/DetailSidebar/styles.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import styled from 'react-emotion';
import Avatar from '@material-ui/core/Avatar';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';

import colors from '../../utils/styles/colors';

export const TitleListItem = styled(ListItem)({
'&&': {
paddingLeft: 0,
Expand All @@ -21,10 +18,14 @@ export const TitleListItemText = styled(ListItemText)({
},
});

export const TitleAvatar = styled(Avatar)({
export const PackageDescription = styled('span')({
'&&': {
display: 'block',
},
});

export const PackageVersion = styled('span')({
'&&': {
color: colors.greySuperLight,
backgroundColor: colors.primary,
textTransform: 'capitalize',
display: 'block',
},
});
2 changes: 1 addition & 1 deletion src/components/Footer/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const Flags = styled('span')`
border-color: ${colors.greyAthens} transparent transparent transparent;
transform: rotate(90deg);
}
${ToolTip}:hover & {
${/* sc-selector */ ToolTip}:hover & {
visibility: visible;
}
}
Expand Down

0 comments on commit 583ddd5

Please sign in to comment.