jake-compoenents 1.0.1 → 1.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.
@@ -45,6 +45,16 @@ var Grid = function Grid(props) {
45
45
  _useState4 = _slicedToArray(_useState3, 2),
46
46
  tiles = _useState4[0],
47
47
  setTiles = _useState4[1];
48
+ var buildTileMeta = function buildTileMeta(compressedUrl, fullsizeUrl, subdirectory, files) {
49
+ return files.map(function (filename, index) {
50
+ return {
51
+ id: "".concat(index, "_").concat(filename),
52
+ name: filename,
53
+ url: "".concat(compressedUrl, "/").concat(subdirectory, "/").concat(filename),
54
+ source: "".concat(fullsizeUrl, "/").concat(filename)
55
+ };
56
+ });
57
+ };
48
58
  var fetchContent = /*#__PURE__*/function () {
49
59
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
50
60
  return _regenerator().w(function (_context) {
@@ -103,7 +113,7 @@ var Grid = function Grid(props) {
103
113
  });
104
114
  var dir = props.directories[category].slice(start, end);
105
115
  if (dir && dir.length > 0) {
106
- var tilesMeta = props.buildTileMetaCallback(category, dir);
116
+ var tilesMeta = buildTileMeta(props.compressedUrl, props.fullsizeUrl, category, dir);
107
117
  setTiles(tilesMeta);
108
118
  } else {
109
119
  setTiles([]);
@@ -151,6 +161,7 @@ var Grid = function Grid(props) {
151
161
  return /*#__PURE__*/_react["default"].createElement(_tile["default"], {
152
162
  id: "tile_".concat(key),
153
163
  name: image.name,
164
+ source: image.source,
154
165
  url: image.url,
155
166
  key: key,
156
167
  tabIndex: key + 1
@@ -45,7 +45,7 @@ var Modal = function Modal(props) {
45
45
  src: props.activeImage.url,
46
46
  alt: "Modal"
47
47
  }), "\uD83D\uDCF7 Click ", /*#__PURE__*/_react["default"].createElement("a", {
48
- href: source,
48
+ href: props.activeImage.source,
49
49
  target: "_blank"
50
50
  }, "here"), " for the full-resolution version."));
51
51
  };
@@ -14,7 +14,8 @@ var Tile = function Tile(props) {
14
14
  props.dispatch((0, _setActiveImage.setActiveImage)({
15
15
  id: props.id,
16
16
  name: props.name,
17
- url: props.url
17
+ url: props.url,
18
+ source: props.source
18
19
  }));
19
20
  };
20
21
  return /*#__PURE__*/_react["default"].createElement("img", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jake-compoenents",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A library of reusable React components to leverage across projects.",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && babel src --out-dir dist --copy-files",
Binary file
Binary file