rwr-view_helpers 0.1.1 → 0.2.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/js/src/index.js +3 -2
- data/js/src/version.js +1 -1
- data/lib/react_webpack_rails/rwr_view_helpers/version.rb +1 -1
- data/package.json +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de1962d5359182d1c0fe8c599216147a81d3cdb6
|
4
|
+
data.tar.gz: 35d04a38931284253ff3149dc5b97f0c5bf1281f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3984cb591dd820ca5cf32e1b45b8fd49bc2a64b0f04ad2098e5c5ec891296feaf20d5ac53300340706a8bfd0b01a5d558c4d459ea3f2f1b02001291cfe4c4b37
|
7
|
+
data.tar.gz: 682b7dfff52e68289afed75db1aa6cfb38fc9552d22c47ba3bd9cb8cc3211a1f76c603814bb3aa4edadf0fbd75549cfb4182206cbe7287815122897249164a3a
|
data/README.md
CHANGED
@@ -26,12 +26,13 @@ First add this require statement in your `/app/assets/javascripts/application.js
|
|
26
26
|
|
27
27
|
Then use it in your React components
|
28
28
|
|
29
|
-
```
|
29
|
+
```js
|
30
30
|
import React from 'react';
|
31
31
|
import { imagePath } from 'rwr-view-helpers';
|
32
|
+
import { facebookIcon } from 'constants/icon-urls';
|
32
33
|
|
33
34
|
export default ({ alt }) => (
|
34
|
-
<img alt={alt} src={imagePath(
|
35
|
+
<img alt={alt} src={imagePath(facebookIcon)} />
|
35
36
|
);
|
36
37
|
```
|
37
38
|
|
data/js/src/index.js
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
export const imagePath =
|
2
|
-
|
1
|
+
export const imagePath = path => typeof window !== 'undefined'
|
2
|
+
? window.__RWR_VIEW_HELPERS__.imagePaths[path] || path
|
3
|
+
: global.__RWR_VIEW_HELPERS__.imagePaths[path] || path;
|
data/js/src/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default '0.
|
1
|
+
export default '0.2.0';
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rwr-view_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oskar Cieslik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: react_webpack_rails
|
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
229
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.
|
230
|
+
rubygems_version: 2.5.1
|
231
231
|
signing_key:
|
232
232
|
specification_version: 4
|
233
233
|
summary: ''
|