This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function UserCard(props) { | |
| var user = props.user; | |
| return React.createElement( | |
| 'div', | |
| { className: 'col-md-offset-1 col-lg-offset-2' }, | |
| React.createElement( | |
| 'div', | |
| { className: 'card fluid', id: "user_" + user.login.username }, | |
| React.createElement( | |
| 'div', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function SvgMapPin(props) { | |
| return React.createElement( | |
| 'svg', | |
| { xmlns: 'http://www.w3.org/2000/svg', width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', stroke: '#424242', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, | |
| React.createElement('path', { d: 'M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z' }), | |
| React.createElement('circle', { cx: '12', cy: '10', r: '3' }) | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Mockup Progressive Web App", | |
| "short_name": "Mock PWA", | |
| "description": "A mock progressive web app built with React and mini.css.", | |
| "lang": "en-US", | |
| "start_url": "./index.html", | |
| "display": "standalone", | |
| "theme_color": "#1a237e", | |
| "icons": [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // "caches" is a global read-only variable, which is an instance of CacheStorage | |
| caches.open(cacheName).then(function(cache) { | |
| // Do something with your cache | |
| }); | |
| // Source: https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage/open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts": { | |
| "start": "react-scripts start", | |
| "build": "react-scripts build && npm run build-rename-replace && npm run build-sw", | |
| "test": "react-scripts test --env=jsdom", | |
| "eject": "react-scripts eject", | |
| "build-sw" : "npm run build-replace-sw-refs && npm run build-minify-sw", | |
| "build-rename-replace": "npm run build-rename && npm run build-replace", | |
| "build-rename": "npm run build-rename-js && npm run build-rename-css", | |
| "build-rename-js": "renamer --regex --find main\\.\\w+\\.js --replace main.js build/static/js/*.js", | |
| "build-rename-css": "renamer --regex --find main\\.\\w+\\.css --replace main.css build/static/css/*.css", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Definition of our comparison function. | |
| var sortByWeight = function(x,y){ | |
| var xW = x.measurement == "kg" ? x.weight : x.weight * 0.453592; | |
| var yW = y.measurement == "kg" ? y.weight : y.weight * 0.453592; | |
| return xW > yW ? 1 : -1; | |
| } | |
| // Just two slightly different lists of data, | |
| // that need to be sorted based on weight. | |
| var firstList = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An array of people. | |
| var myFriends = [ | |
| { name: "John", gender: "male" }, | |
| { name: "Kate", gender: "female" }, | |
| { name: "Mike", gender: "male" }, | |
| { name: "Sophie", gender: "female" }, | |
| { name: "Richard", gender: "male" }, | |
| { name: "Keith", gender: "male" } | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An array of high scores. Notice that some | |
| // of them don't have a name specified. | |
| var highScores = [ | |
| {score: 237, name: "Jim"}, | |
| {score: 108, name: "Kit"}, | |
| {score: 91, name: "Rob"}, | |
| {score: 0}, | |
| {score: 0} | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An array of objects. | |
| var myFriends = [ | |
| { name: "John", surname: "Smith", age: 52}, | |
| { name: "Sarah", surname: "Smith", age: 49}, | |
| { name: "Michael", surname: "Jones", age: 46}, | |
| { name: "Garry", surname: "Thomas", age: 48} | |
| ]; | |
| // A simple function to get just the name and | |
| // surname in one string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Arrays of expenses. | |
| var oldExpenses = [ | |
| { company: "BigCompany Co.", value: 1200.10}, | |
| { company: "Pineapple Inc.", value: 3107.02}, | |
| { company: "Office Supplies Inc.", value: 266.97} | |
| ]; | |
| var newExpenses = [ | |
| { company: "Office Supplies Inc.", value: 108.11}, | |
| { company: "Megasoft Co.", value: 1208.99} | |
| ]; |
OlderNewer