Skip to content

Commit 204892c

Browse files
committed
Add prettify behavior on Row & Film 💅
* Fix Row rerender * Fix Grid loading * Fix webpack memory leak
1 parent 1dc8c3b commit 204892c

23 files changed

+1353
-133
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Tips: Sensorr will use your `config.js` and fallback on default
200200
* `WebUI`
201201
* Fix
202202
* Remove `aphrodite`
203-
* Migrate from `webpack` to `parcel` ?
203+
* Refactor `config` to `settings` using [mozilla/node-convict](https://github.com/mozilla/node-convict)
204204
* Look at [`react-slot-fill`](https://github.com/camwest/react-slot-fill)
205205
* Fix empty `Film` link, cf. `/movies/search/Thomas Crown`
206206
* Fix `order=release_date`, cf. `/star/19274`
@@ -216,11 +216,6 @@ Tips: Sensorr will use your `config.js` and fallback on default
216216
* Show/Hide results on `focus/blur` - ?
217217
* Add right `select` `in [All|Movie|Collection|Star]` - ? (see [inspiration](https://mir-s3-cdn-cf.behance.net/project_modules/2800_opt_1/4b75c062431121.5a990e65204e6.png))
218218
* Display grouped results as a small `List`, not `Row`
219-
* `Row`
220-
* Beautify `n` firsts
221-
* Use offset (see [inspiration](https://dribbble.com/shots/2647399-Sneak-Peek-Unique-UI))
222-
* Use `backdrop_path` (blurred ? see [inspiration](https://dribbble.com/shots/4525124-Online-streaming-Web-App-UI))
223-
* Use custom colors (use `react-image-palette`, see [inspiration](https://dribbble.com/shots/4859422-Lights-Camera-Cinero))
224219
* Add contextual data on `Film` & `Persona` when filtered or sorted
225220
* Add `label` "tag" on left (with emoji ?) - ?
226221
* `:hover`, bottom to top animation revealing overlay (see [inspiration](https://dribbble.com/shots/4649643-Cinematic-UI))
@@ -233,6 +228,11 @@ Tips: Sensorr will use your `config.js` and fallback on default
233228
* Improve `Row` integration (see [inspiration](https://dribbble.com/shots/4131890-Cinema-Website))
234229
* Improve `Button` (& global layout, see [inspiration](https://dribbble.com/shots/5532138-UI-Design-002-Minions)) colors with `picked` colors from `poster` (use `react-image-palette`, see [inspiration](https://dribbble.com/shots/4859422-Lights-Camera-Cinero))
235230
* Add `keywords`
231+
* Add `policies`
232+
* `Checkbox` displayed as grid or column
233+
* After `Row` ? - Bad UX, far away from `state`
234+
* Create `policy` option (will copy/paste `default`)
235+
* Edit `policy` link
236236
* `Upcoming`
237237
* Improve performance
238238
* Add release day as contextual data on `Film`

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"atob": "2.1.2",
2525
"body-parser": "1.19.0",
2626
"chalk": "2.4.2",
27+
"color": "^3.1.2",
2728
"compression": "1.7.4",
2829
"core-js": "3.2.1",
2930
"country-emoji": "1.4.4",
@@ -82,6 +83,7 @@
8283
"universal-rxjs-ajax": "2.0.3",
8384
"universal-url": "2.0.0",
8485
"uuid": "3.3.3",
86+
"worker-plugin": "^3.2.0",
8587
"xml2json-light": "1.0.6"
8688
},
8789
"devDependencies": {

shared/Documents.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ class Movie {
77
this.countries = ['US', 'UK', region.split('-').pop()]
88
}
99

10+
judge() {
11+
const { vote_average } = this.payload
12+
13+
if (!vote_average) {
14+
return '🤷'
15+
} else if (vote_average < 5) {
16+
return '👎'
17+
} else if (vote_average < 7) {
18+
return '👍'
19+
} else if (vote_average < 7.5) {
20+
return '👏'
21+
} else if (vote_average < 8) {
22+
return '🙌'
23+
} else {
24+
return '🙏'
25+
}
26+
}
27+
1028
normalize() {
1129
return {
1230
id: this.payload.id.toString(),

shared/utils/string.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,17 @@ module.exports = {
99
.replace(/[^\sa-zA-Z0-9]/g, ' ')
1010
.replace(/ +/g, ' ')
1111
.trim(),
12+
truncate: (str, limit = 300, options = { ellipsis: '...' }) => {
13+
const sentences = str.split(/[\.\,\;\?\!]+/)
14+
const position = Math.abs(sentences.reduce((length, sentence) =>
15+
length < 0 ?
16+
length :
17+
limit > length + sentence.length ?
18+
length + sentence.length + 1 :
19+
-Math.abs(length),
20+
0,
21+
))
22+
23+
return position === str.length ? str : `${str.substring(0, position - 1).trimEnd()}${options.ellipsis}`
24+
},
1225
}

src/components/Empty.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const styles = {
2828
}
2929
}
3030

31-
const Empty = ({ style, emoji, title, subtitle, ...props }) => (
32-
<div style={{ ...styles.element, ...style }}>
33-
<h1 style={styles.emoji}>{emoji}</h1>
34-
<h2 style={styles.title}>{title}</h2>
35-
<p style={styles.subtitle}>{subtitle}</p>
31+
const Empty = ({ emoji, title, subtitle, ...props }) => (
32+
<div {...props} css={[styles.element, props.css]}>
33+
<h1 css={styles.emoji}>{emoji}</h1>
34+
<h2 css={styles.title}>{title}</h2>
35+
<p css={styles.subtitle}>{subtitle}</p>
3636
</div>
3737
)
3838

0 commit comments

Comments
 (0)