There is a simple user avatar component with an upload button:

There are some requirements we need to meet:
- both image and icon should be clickable;
- icon should be accessible with keyboard;
| const fetchMachine = Machine({ | |
| id: 'search', | |
| initial: 'idle', | |
| context: { | |
| search: '', | |
| isDropdownRendered: false, | |
| maxFocusedIndex: 0, | |
| focusedIndex: -1, | |
| }, |
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
| html { | |
| font-size: calc(1vmin + 1.6vh + 1.6vw); | |
| } | |
| grid { | |
| display: grid; | |
| grid-gap: 1rem; | |
| justify-content: center; | |
| grid-template-columns: 40% 40%; | |
| } |
| Title | Hotkey | URL |
|---|---|---|
| Hacker | h | https://encrypted.google.com/?hl=xx-hacker&q=%s |
| Hacker:Year | hy | https://encrypted.google.com/?hl=xx-hacker&tbs=qdr:y&q=%s |
| Hacker:Month | hm | https://encrypted.google.com/?hl=xx-hacker&tbs=qdr:m&q=%s |
| Hacker:Week | hw | https://encrypted.google.com/?hl=xx-hacker&tbs=qdr:w&q=%s |
| Hacker:Day | hd | https://encrypted.google.com/?hl=xx-hacker&tbs=qdr:d&q=%s |
| Hacker:Hour | hh | https://encrypted.google.com/?hl=xx-hacker&tbs=qdr:h&q=%s |
| Hacker:Images | hi | https://encrypted.google.com/search?hl=xx-hacker&tbm=isch&q=%s |
| new Array(100) | |
| .fill(0) | |
| .map((e, i) => i + 1) | |
| .map(id => [[3, 'Miss'], [5, 'Kiss']].reduceRight((p, c) => id % c[0] === 0 ? c[1] + p : p, '') || id) | |
| .map((e, i) => setTimeout(() => console.log(e), i * 50)); |
| new Array(100) | |
| .fill(0) | |
| .map((e, i) => i + 1) | |
| .map(e => e % 3 === 0 ? (e % 5 === 0 ? 'MissKiss' : 'Miss') : e % 5 === 0 ? 'Kiss' : e) | |
| .map((e, i) => setTimeout(() => console.log(e), i * 50)); |