diff --git a/src/webui/components/Package/index.js b/src/webui/components/Package/index.js index 7f6bca976..d4ca31489 100644 --- a/src/webui/components/Package/index.js +++ b/src/webui/components/Package/index.js @@ -49,20 +49,32 @@ import { } from './styles'; import { fontWeight } from '../../utils/styles/sizes'; -const getInitialsName = (name: string) => - name - .split(' ') - .reduce((accumulator, currentValue) => accumulator.charAt(0) + currentValue.charAt(0), '') - .toUpperCase(); +// const getInitialsName = (name: string) => +// name +// .split(' ') +// .reduce((accumulator, currentValue) => accumulator.charAt(0) + currentValue.charAt(0), '') +// .toUpperCase(); -const Package = ({ name: label, version, dist: { unpackedSize } = {}, time, author: { name, avatar }, description, license, keywords = [] }: IProps): Element => { - console.log(unpackedSize); - const renderVersionInfo = () => version && ( - - - {`v${version}`} - - ); +const Package = ({ + name: label, + version, + dist: { unpackedSize } = {}, + time, + author: { name, avatar }, + description, + license, + keywords = [], + homepage, + bugs, +}: IProps): Element => { + console.log(homepage); + const renderVersionInfo = () => + version && ( + + + {`v${version}`} + + ); const renderAuthorInfo = () => { return ( @@ -73,19 +85,16 @@ const Package = ({ name: label, version, dist: { unpackedSize } = {}, time, auth ); -<<<<<<< HEAD - }; -======= } - const renderFileSize = () => unpackedSize && ( - - - {fileSizeSI(unpackedSize)} - - ); + const renderFileSize = () => + unpackedSize && ( + + + {fileSizeSI(unpackedSize)} + + ); ->>>>>>> b4b8d6b0... wip const renderLicenseInfo = () => license && ( @@ -137,34 +146,50 @@ const Package = ({ name: label, version, dist: { unpackedSize } = {}, time, auth )); + const renderHomePageLink = () => + homepage && ( + + + + + + + + ); + + const renderBugsLink = () => + bugs && + bugs.url && ( + + + + + + + + ); + return ( - + - {/* - - */} - - {label} + + {label} + - - - - - - - - - - - - - - - - + + {renderHomePageLink()} + {renderBugsLink()} + {/* + + + + */} } @@ -173,9 +198,7 @@ const Package = ({ name: label, version, dist: { unpackedSize } = {}, time, auth {description} - {tags.length > 0 && - {tags} - } + {tags.length > 0 && {tags}} } /> diff --git a/src/webui/components/Package/styles.js b/src/webui/components/Package/styles.js index 0ae468d74..258ad07af 100644 --- a/src/webui/components/Package/styles.js +++ b/src/webui/components/Package/styles.js @@ -161,41 +161,41 @@ export const Footer = styled.div` // Container export const WrapperLink = styled(Link)` && { - font-size: 12px; - background-color: white; - margin: 0 0 15px 0; - transition: box-shadow 0.15s; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); - border-radius: 3px; - padding: 10px; + // font-size: 12px; + // background-color: white; + // margin: 0 0 15px 0; + // transition: box-shadow 0.15s; + // box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); + // border-radius: 3px; + // padding: 10px; text-decoration: none; - display: block; - color: #2f273c; - ${mq.medium(css` - ${Header} { - flex-direction: row; - justify-content: space-between; - align-items: center; - } - ${OverviewItem} { - margin: 0 0 0 0; - } - ${Overview} { - flex-direction: row; - ${OverviewItem} { - :first-child { - margin: 0; - } - } - } - ${Footer} { - display: block; - } - ${Published} { - display: inline-block; - } - `)}; - } + // display: block; + // color: #2f273c; + // ${mq.medium(css` + // ${Header} { + // flex-direction: row; + // justify-content: space-between; + // align-items: center; + // } + // ${OverviewItem} { + // margin: 0 0 0 0; + // } + // ${Overview} { + // flex-direction: row; + // ${OverviewItem} { + // :first-child { + // margin: 0; + // } + // } + // } + // ${Footer} { + // display: block; + // } + // ${Published} { + // display: inline-block; + // } + // `)}; + // } `; /** diff --git a/src/webui/components/PackageList/index.js b/src/webui/components/PackageList/index.js index ab607e40a..b32f8b179 100644 --- a/src/webui/components/PackageList/index.js +++ b/src/webui/components/PackageList/index.js @@ -25,13 +25,13 @@ export default class PackageList extends React.Component { const { packages } = this.props; return ( packages.map((pkg, i) => { - const { name, version, description, time, keywords, dist } = pkg; + const { name, version, description, time, keywords, dist, homepage, bugs } = pkg; const author = pkg.author; const license = formatLicense(pkg.license); return ( {i !== 0 && } - + ); })