forked from sombochea/verdaccio-ui
fix: some warnings in console (#155)
* fix: remove react emotion selector warning * fix: validate DOM nesting
This commit is contained in:
parent
7bd9eb7a07
commit
583ddd555a
@ -14,14 +14,18 @@ import Repository from '../Repository/Repository';
|
|||||||
|
|
||||||
import { DetailContext } from '../../pages/Version';
|
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 => {
|
const renderLatestDescription = (description, version, isLatest: boolean = true): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<span>
|
<>
|
||||||
<div>{description}</div>
|
<PackageDescription>{description}</PackageDescription>
|
||||||
{version ? <small>{`${isLatest ? 'Latest v' : 'v'}${version}`}</small> : null}
|
{version ? (
|
||||||
</span>
|
<PackageVersion>
|
||||||
|
<small>{`${isLatest ? 'Latest v' : 'v'}${version}`}</small>
|
||||||
|
</PackageVersion>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import styled from 'react-emotion';
|
import styled from 'react-emotion';
|
||||||
import Avatar from '@material-ui/core/Avatar';
|
|
||||||
import ListItem from '@material-ui/core/ListItem';
|
import ListItem from '@material-ui/core/ListItem';
|
||||||
import ListItemText from '@material-ui/core/ListItemText';
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
|
|
||||||
import colors from '../../utils/styles/colors';
|
|
||||||
|
|
||||||
export const TitleListItem = styled(ListItem)({
|
export const TitleListItem = styled(ListItem)({
|
||||||
'&&': {
|
'&&': {
|
||||||
paddingLeft: 0,
|
paddingLeft: 0,
|
||||||
@ -21,10 +18,14 @@ export const TitleListItemText = styled(ListItemText)({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const TitleAvatar = styled(Avatar)({
|
export const PackageDescription = styled('span')({
|
||||||
'&&': {
|
'&&': {
|
||||||
color: colors.greySuperLight,
|
display: 'block',
|
||||||
backgroundColor: colors.primary,
|
},
|
||||||
textTransform: 'capitalize',
|
});
|
||||||
|
|
||||||
|
export const PackageVersion = styled('span')({
|
||||||
|
'&&': {
|
||||||
|
display: 'block',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -90,7 +90,7 @@ export const Flags = styled('span')`
|
|||||||
border-color: ${colors.greyAthens} transparent transparent transparent;
|
border-color: ${colors.greyAthens} transparent transparent transparent;
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
${ToolTip}:hover & {
|
${/* sc-selector */ ToolTip}:hover & {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user