@bigbinary/neeto-image-uploader-frontend 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ var Input = require('@bigbinary/neetoui/Input');
26
26
  var Switch = require('@bigbinary/neetoui/Switch');
27
27
  var Label = require('@bigbinary/neetoui/Label');
28
28
  var jsxRuntime = require('react/jsx-runtime');
29
+ var NoData = require('@bigbinary/neetoui/NoData');
29
30
  var query = require('./query-BslM05TL.js');
30
31
  var MenuHorizontal = require('@bigbinary/neeto-icons/MenuHorizontal');
31
32
  var constants = require('@bigbinary/neeto-team-members-frontend/constants');
@@ -1878,7 +1879,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
1878
1879
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
1879
1880
  });
1880
1881
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1881
- className: "niu-unsplash-container me-2 max-w-full overflow-x-hidden overflow-y-scroll",
1882
+ className: "niu-unsplash-container grow max-w-full overflow-x-hidden overflow-y-scroll",
1882
1883
  children: [/*#__PURE__*/jsxRuntime.jsx(_default, {
1883
1884
  hasMore: hasMore,
1884
1885
  loadMore: loadMore,
@@ -1987,18 +1988,28 @@ var Images = function Images(_ref) {
1987
1988
  isLoading = _useFetchAssets.isLoading,
1988
1989
  isError = _useFetchAssets.isError;
1989
1990
  if (isError) {
1990
- return /*#__PURE__*/jsxRuntime.jsx(Typography, {
1991
- className: "mt-9 flex justify-center",
1992
- style: "body2",
1993
- children: t("neetoImageUploader.unsplash.errorMessage")
1991
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
1992
+ className: "grow flex justify-center items-center",
1993
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1994
+ style: "body2",
1995
+ children: t("neetoImageUploader.unsplash.errorMessage")
1996
+ })
1994
1997
  });
1995
1998
  }
1996
1999
  if (isLoading) {
1997
2000
  return /*#__PURE__*/jsxRuntime.jsx("div", {
1998
- className: "flex justify-around",
2001
+ className: "grow flex justify-center items-center",
1999
2002
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
2000
2003
  });
2001
2004
  }
2005
+ if (ramda.isEmpty(results)) {
2006
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
2007
+ className: "grow flex justify-center items-center",
2008
+ children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
2009
+ title: t("neetoImageUploader.common.noImagesToShow")
2010
+ })
2011
+ });
2012
+ }
2002
2013
  return /*#__PURE__*/g.createElement(InfiniteScroller, {
2003
2014
  setSelectedImage: setSelectedImage,
2004
2015
  hasMore: hasNextPage,
@@ -2121,18 +2132,28 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
2121
2132
  isError = _useFetchUnsplashImag.isError,
2122
2133
  isLoading = _useFetchUnsplashImag.isLoading;
2123
2134
  if (isError) {
2124
- return /*#__PURE__*/jsxRuntime.jsx(Typography, {
2125
- className: "mt-9 flex justify-center",
2126
- style: "body2",
2127
- children: t("neetoImageUploader.unsplash.errorMessage")
2135
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
2136
+ className: "grow flex justify-center items-center",
2137
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
2138
+ style: "body2",
2139
+ children: t("neetoImageUploader.unsplash.errorMessage")
2140
+ })
2128
2141
  });
2129
2142
  }
2130
2143
  if (isLoading) {
2131
2144
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2132
- className: "flex justify-around",
2145
+ className: "grow flex justify-center items-center",
2133
2146
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
2134
2147
  });
2135
2148
  }
2149
+ if (ramda.isEmpty(results)) {
2150
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
2151
+ className: "grow flex justify-center items-center",
2152
+ children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
2153
+ title: t("neetoImageUploader.common.noImagesToShow")
2154
+ })
2155
+ });
2156
+ }
2136
2157
  return /*#__PURE__*/g.createElement(InfiniteScroller, {
2137
2158
  debouncedQuery: debouncedQuery,
2138
2159
  handleUnsplashImageSelect: handleUnsplashImageSelect,
@@ -2161,18 +2182,20 @@ var ImageLibrary = function ImageLibrary(_ref) {
2161
2182
  setQuery("");
2162
2183
  }, [tab]);
2163
2184
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
2164
- className: "w-full px-6 pb-2 pt-1",
2165
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
2166
- autoFocus: true,
2167
- className: "mb-4",
2168
- "data-testid": "niu-unsplash-image-picker-search-input",
2169
- name: "text",
2170
- placeholder: inputPlaceHolder,
2171
- value: query,
2172
- onChange: function onChange(_ref2) {
2173
- var value = _ref2.target.value;
2174
- return setQuery(value);
2175
- }
2185
+ className: "w-full px-6 py-4 grow flex flex-col",
2186
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
2187
+ className: "mb-4 shrink-0",
2188
+ children: /*#__PURE__*/jsxRuntime.jsx(Input, {
2189
+ autoFocus: true,
2190
+ "data-testid": "niu-unsplash-image-picker-search-input",
2191
+ name: "text",
2192
+ placeholder: inputPlaceHolder,
2193
+ value: query,
2194
+ onChange: function onChange(_ref2) {
2195
+ var value = _ref2.target.value;
2196
+ return setQuery(value);
2197
+ }
2198
+ })
2176
2199
  }), tab === utils$1.TABS[1].key ? /*#__PURE__*/jsxRuntime.jsx(Images, {
2177
2200
  debouncedQuery: debouncedQuery,
2178
2201
  query: query,
@@ -2297,7 +2320,7 @@ var Modal = function Modal(_ref) {
2297
2320
  var renderContent = function renderContent() {
2298
2321
  if (activeTab === "upload") {
2299
2322
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2300
- className: "grow px-6 pb-6",
2323
+ className: "grow px-6 pb-6 pt-4",
2301
2324
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
2302
2325
  className: "h-full w-full overflow-y-auto",
2303
2326
  children: /*#__PURE__*/jsxRuntime.jsx(utils$1.ImageDirectUpload, {
@@ -2350,7 +2373,7 @@ var Modal = function Modal(_ref) {
2350
2373
  children: t("neetoImageUploader.common.imageLibrary")
2351
2374
  })
2352
2375
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
2353
- className: "flex gap-2 px-6 py-2",
2376
+ className: "flex gap-2 px-6",
2354
2377
  children: /*#__PURE__*/jsxRuntime.jsx(Tab, {
2355
2378
  size: "small",
2356
2379
  children: utils$1.TABS.map(function (tab) {
@@ -2367,6 +2390,7 @@ var Modal = function Modal(_ref) {
2367
2390
  }), renderContent(), ramda.equals(activeTab, utils$1.TABS[2].key) && /*#__PURE__*/jsxRuntime.jsx(NeetoUIModal.Footer, {
2368
2391
  className: "flex items-center justify-center gap-2",
2369
2392
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
2393
+ lineHeight: "none",
2370
2394
  style: "body2",
2371
2395
  children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
2372
2396
  i18nKey: "neetoImageUploader.unsplash.poweredByUnsplash",
@@ -2386,4 +2410,4 @@ var Modal = function Modal(_ref) {
2386
2410
 
2387
2411
  exports.Modal = Modal;
2388
2412
  exports.constructCloudflareImageURL = constructCloudflareImageURL;
2389
- //# sourceMappingURL=index-IvuywClK.js.map
2413
+ //# sourceMappingURL=index-Dduujv9L.js.map