Skip to content

Commit f2f1b5c

Browse files
committedNov 11, 2017
showing users a card list of screens that can be recorded
1 parent ef55e9b commit f2f1b5c

15 files changed

+3378
-12
lines changed
 

‎index.js ‎main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const url = require('url');
55
const MainWindow = require('./app/MainWindow');
66
const CaptureTray = require('./app/CaptureTray');
7-
const { app, BrowserWIndow, Tray, Menu } = electron;
7+
const { app, BrowserWIndow, Tray, Menu, ipcMain, desktopCapturer } = electron;
88
const startUrl = require('./config/keys').startUrl;
99

1010
let mainWindow;

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "capture",
33
"version": "0.1.0",
44
"private": true,
5-
"main": "index.js",
5+
"main": "main.js",
66
"devDependencies": {
77
"electron": "^1.7.9"
88
},
140 KB
Binary file not shown.

‎public/iconfont/MaterialIcons-Regular.ijmap

+1
Large diffs are not rendered by default.

‎public/iconfont/MaterialIcons-Regular.svg

+2,373
Loading
125 KB
Binary file not shown.
76.9 KB
Binary file not shown.
41.3 KB
Binary file not shown.

‎public/iconfont/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The recommended way to use the Material Icons font is by linking to the web font hosted on Google Fonts:
2+
3+
```html
4+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
5+
rel="stylesheet">
6+
```
7+
8+
Read more in our full usage guide:
9+
http://google.github.io/material-design-icons/#icon-font-for-the-web

‎public/iconfont/codepoints

+932
Large diffs are not rendered by default.

‎public/iconfont/material-icons.css

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@font-face {
2+
font-family: 'Material Icons';
3+
font-style: normal;
4+
font-weight: 400;
5+
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
6+
src: local('Material Icons'),
7+
local('MaterialIcons-Regular'),
8+
url(MaterialIcons-Regular.woff2) format('woff2'),
9+
url(MaterialIcons-Regular.woff) format('woff'),
10+
url(MaterialIcons-Regular.ttf) format('truetype');
11+
}
12+
13+
.material-icons {
14+
font-family: 'Material Icons';
15+
font-weight: normal;
16+
font-style: normal;
17+
font-size: 24px; /* Preferred icon size */
18+
display: inline-block;
19+
width: 1em;
20+
height: 1em;
21+
line-height: 1;
22+
text-transform: none;
23+
letter-spacing: normal;
24+
word-wrap: normal;
25+
white-space: nowrap;
26+
direction: ltr;
27+
28+
/* Support for all WebKit browsers. */
29+
-webkit-font-smoothing: antialiased;
30+
/* Support for Safari and Chrome. */
31+
text-rendering: optimizeLegibility;
32+
33+
/* Support for Firefox. */
34+
-moz-osx-font-smoothing: grayscale;
35+
36+
/* Support for IE. */
37+
font-feature-settings: 'liga';
38+
}

‎public/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
-->
1111
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
1212
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
13+
<!-- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> -->
14+
<link href="/iconfont/material-icons.css" rel="stylesheet" />
1415
<!--
1516
Notice the use of %PUBLIC_URL% in the tags above.
1617
It will be replaced with the URL of the `public` folder during the build.

‎src/actions/record_actions.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { GET_SCREEN_SOURCES } from './types';
22
import { asyncToPromise } from '../utils/utils'
3-
const { ipcRenderer, desktopCapturer } = window.electron;
3+
const electron = window.electron;
4+
const { desktopCapturer } = electron;
45

56
export const getUserScreens = () => async dispatch => {
67

7-
let sources = await asyncToPromise(desktopCapturer.getSources, { types: ['window', 'screen'] } );
8+
let sources = await asyncToPromise(desktopCapturer.getSources, { types: ['window', 'screen'] });
9+
console.log('sources, ', sources );
810

911
dispatch({ type: GET_SCREEN_SOURCES, payload: sources });
10-
1112
};

‎src/components/Card.js

Whitespace-only changes.

‎src/screens/HomeScreen.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ class HomeScreen extends Component {
1111
}
1212

1313
renderScreenSources = () => {
14-
return _.map(this.props.screenSources, (source) => {
14+
return _.map(this.props.screenSources, ({ id, name, thumbnail}) => {
15+
let thumbUrl = `'${thumbnail.toDataURL('image/jpeg')}'`
16+
console.log('thumbUrl', thumbUrl);
1517
return (
16-
<div>
17-
<div>
18-
19-
</div>
20-
</div>
18+
<div className="row" key={id}>
19+
<div className="col s12 m6">
20+
<div className="card blue-grey darken-1">
21+
<div className="card-content white-text">
22+
<span className="card-title">{name.slice(0,20)}</span>
23+
<img src={thumbnail.toDataURL()} />
24+
</div>
25+
<div className="card-action">
26+
<a href="#">Record</a>
27+
</div>
28+
</div>
29+
</div>
30+
</div>
2131

2232
)
2333
});
@@ -30,6 +40,7 @@ class HomeScreen extends Component {
3040
<div>
3141
<div>HomeScreen</div>
3242
<div>HomeScreen</div>
43+
{this.renderScreenSources()}
3344
</div>
3445
);
3546
}

0 commit comments

Comments
 (0)
Please sign in to comment.