diff --git a/src/BaGet.UI/src/DisplayPackage/Dependencies.tsx b/src/BaGet.UI/src/DisplayPackage/Dependencies.tsx index be23a9d6e..ae947409b 100644 --- a/src/BaGet.UI/src/DisplayPackage/Dependencies.tsx +++ b/src/BaGet.UI/src/DisplayPackage/Dependencies.tsx @@ -6,7 +6,7 @@ interface IDependenciesProps { } interface IPackageDependenciesProps { - dependencies: Registration.IDependency[]; + dependencies: Registration.IDependency[] | undefined; } class Dependencies extends React.Component { @@ -58,7 +58,7 @@ class PackageDependencies extends React.Component { } public render() { - if (this.props.dependencies.length === 0) { + if (!this.props.dependencies || this.props.dependencies.length === 0) { return
No dependencies.
} diff --git a/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx b/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx index 79bdaed08..0843f8e63 100644 --- a/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx +++ b/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx @@ -1,6 +1,7 @@ import { HtmlRenderer, Parser } from 'commonmark'; import { Icon } from 'office-ui-fabric-react/lib/Icon'; import * as React from 'react'; +import { Link } from 'react-router-dom'; import timeago from 'timeago.js'; import Dependencies from './Dependencies'; import InstallationInfo from './InstallationInfo'; @@ -14,6 +15,7 @@ interface IDisplayPackageProps { match: { params: { id: string; + version?: string; } } } @@ -30,9 +32,10 @@ interface IPackage { repositoryUrl: string; repositoryType: string; totalDownloads: number; - latestDownloads: number; + downloads: number; authors: string; tags: string[]; + version: string; versions: IPackageVersion[]; dependencyGroups: Registration.IDependencyGroup[]; } @@ -50,6 +53,7 @@ interface IDisplayPackageState { class DisplayPackage extends React.Component { private id: string; + private version?: string; private parser: Parser; private htmlRenderer: HtmlRenderer; @@ -61,10 +65,12 @@ class DisplayPackage extends React.Component { return response.text(); @@ -161,12 +182,12 @@ class DisplayPackage extends React.Component

{this.state.package.id} - {this.state.package.latestVersion} + {this.state.package.version}

- + {/* TODO: Fix this */}
@@ -207,7 +228,7 @@ class DisplayPackage extends React.Component
  • - {this.state.package.latestDownloads.toLocaleString()} downloads of latest version + {this.state.package.downloads.toLocaleString()} downloads of latest version
  • @@ -217,7 +238,7 @@ class DisplayPackage extends React.Component (
    - v{value.version}: + {value.version}: {this.dateToString(value.date)}
    ))} diff --git a/src/BaGet.UI/src/DisplayPackage/Registration.tsx b/src/BaGet.UI/src/DisplayPackage/Registration.tsx index 93e103d06..75cfb08cc 100644 --- a/src/BaGet.UI/src/DisplayPackage/Registration.tsx +++ b/src/BaGet.UI/src/DisplayPackage/Registration.tsx @@ -34,7 +34,7 @@ export interface ICatalogEntry { export interface IDependencyGroup { targetFramework: string; - dependencies: IDependency[]; + dependencies: IDependency[] | undefined; } export interface IDependency { diff --git a/src/BaGet.UI/src/index.tsx b/src/BaGet.UI/src/index.tsx index b0a0b1e2a..efc287762 100644 --- a/src/BaGet.UI/src/index.tsx +++ b/src/BaGet.UI/src/index.tsx @@ -18,7 +18,7 @@ initializeIcons(); ReactDOM.render( - +