1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-19 01:25:51 +07:00

chore: sync with verdaccio master

This commit is contained in:
Juan Picado @jotadeveloper
2019-04-04 21:23:40 +02:00
parent 133a5f0171
commit 3506f32ad8
241 changed files with 57691 additions and 1932 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -1,78 +0,0 @@
/* eslint-disable */
import React, {Component} from 'react';
import Avatar from '@material-ui/core/Avatar/index';
import Grid from '@material-ui/core/Grid/index';
import List from '@material-ui/core/List/index';
import ListItemText from '@material-ui/core/ListItemText/index';
import { DetailContextConsumer } from '../../pages/version/index';
import { Heading, EngineListItem } from './styles';
import node from './img/node.png';
import npm from '../Install/img/npm.svg'
const ICONS = {
'node-JS': <Avatar src={node} />,
'NPM-version': <Avatar src={npm} />,
}
class Engine extends Component {
render() {
return (
<DetailContextConsumer>
{(context) => {
return this.renderEngine(context);
}}
</DetailContextConsumer>
);
};
renderEngine = ({packageMeta}) => {
const { engines } = packageMeta.latest;
if (!engines) {
return null;
}
const engineDict = {
'node-JS': engines.node,
'NPM-version': engines.npm
}
const items = Object.keys(engineDict).reduce((markup, text, key) => {
const heading = engineDict[text]
if (heading){
markup.push(
<Grid item={true} xs={6} key={key}>
{this.renderListItems(heading, text)}
</Grid>
);
}
return markup;
}, []);
if (items.length < 1) {
return null;
}
return (
<Grid container={true}>
{items}
</Grid>
);
}
renderListItems = (heading, text) => {
return (
<List subheader={<Heading variant={"subheading"}>{text.split('-').join(' ')}</Heading>}>
<EngineListItem>
{ ICONS[text] }
<ListItemText primary={heading} />
</EngineListItem>
</List>
);
}
}
export default Engine;

View File

@@ -1,21 +0,0 @@
/**
* @prettier
* @flow
*/
import styled from 'react-emotion';
import ListItem from '@material-ui/core/ListItem/index';
import Typography from '@material-ui/core/Typography/index';
export const Heading = styled(Typography)`
&& {
font-weight: 700;
text-transform: capitalize;
}
`;
export const EngineListItem = styled(ListItem)`
&& {
padding-left: 0;
}
`;