diff --git a/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx b/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx index 385d1f83..a531e26a 100644 --- a/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx +++ b/src/BaGet.UI/src/DisplayPackage/DisplayPackage.tsx @@ -205,7 +205,12 @@ class DisplayPackage extends React.ComponentCould not find package '{this.id}'. +
+

Oops, package not found...

+

Could not find package '{this.id}'.

+

You can try searching on nuget.org package.

+

Think there's a problem? Consider taking a look at our documentation or asking for help on our GitHub project

+
); } else { return ( diff --git a/src/BaGet.UI/src/SearchResults.tsx b/src/BaGet.UI/src/SearchResults.tsx index eccd843f..ce2094d4 100644 --- a/src/BaGet.UI/src/SearchResults.tsx +++ b/src/BaGet.UI/src/SearchResults.tsx @@ -25,6 +25,7 @@ interface ISearchResultsState { packageType: string; targetFramework: string; items: IPackage[]; + loading: boolean; } interface ISearchResponse { @@ -42,7 +43,8 @@ class SearchResults extends React.Component - {this.state.items.map(value => ( -
-
- The package icon -
-
-
- {value.id} - by: {value.authors} + + {(() => { + if (this.state.loading || this.state.items.length > 0) { + return this.state.items.map(value => ( +
+
+ The package icon +
+
+
+ {value.id} + by: {value.authors} +
+
    +
  • + + + {value.totalDownloads.toLocaleString()} total downloads + +
  • +
  • + + + Latest version: {value.version} + +
  • + {value.tags.length > 0 && +
  • + + + {value.tags.join(' ')} + +
  • + } +
+
+ {value.description} +
+
-
    -
  • - - - {value.totalDownloads.toLocaleString()} total downloads - -
  • -
  • - - - Latest version: {value.version} - -
  • - {value.tags.length > 0 && -
  • - - - {value.tags.join(' ')} - -
  • - } -
+ )); + } + else + { + return (
- {value.description} +

Oops, nothing here...

+

+ It looks like there's no package here to see. Take a look below for useful links. +

+

Upload a package

+

BaGet documentation

+

BaGet issues

-
-
- ))} + ); + } + })()} +
); } @@ -217,6 +239,7 @@ class SearchResults extends React.Component {