mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
* Step 1: move electorn into `app/`. This is to comply with the suggested directory format of `electron-builder`: https://github.com/electron-userland/electron-builder#two-packagejson-structure * Step 2: add build directory with icon files for mac / windows * Step 3: move all development (web) assets into main directory * Step 4: add `build` namespace to dev `package.json` * Step 5: move all dev dependencies into dev file and get rid of old electron packagers in favor of `eletorn-builder` * Step 6: target build inside `app/` as everything else is excluded at build time * Step 7: remove old stuff! * Step 8: update README * turn off asar for `child_pty`
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
import Notifications from '../components/notifications';
|
|
import { installUpdate } from '../actions/updater';
|
|
import { connect } from '../utils/plugins';
|
|
import { dismissNotification } from '../actions/notifications';
|
|
|
|
const NotificationsContainer = connect(
|
|
(state) => {
|
|
const { ui } = state;
|
|
const { notifications } = ui;
|
|
const state_ = {};
|
|
|
|
if (notifications.font) {
|
|
const fontSize = ui.fontSizeOverride || ui.fontSize;
|
|
|
|
Object.assign(state_, {
|
|
fontShowing: true,
|
|
fontSize,
|
|
fontText: `${fontSize}px`
|
|
});
|
|
}
|
|
|
|
if (notifications.resize) {
|
|
const cols = ui.cols;
|
|
const rows = ui.rows;
|
|
|
|
Object.assign(state_, {
|
|
resizeShowing: true,
|
|
cols,
|
|
rows
|
|
});
|
|
}
|
|
|
|
if (notifications.updates) {
|
|
Object.assign(state_, {
|
|
updateShowing: true,
|
|
updateVersion: ui.updateVersion,
|
|
updateNote: ui.updateNotes.split('\n')[0]
|
|
});
|
|
}
|
|
|
|
return state_;
|
|
},
|
|
(dispatch) => {
|
|
return {
|
|
onDismissFont: () => {
|
|
dispatch(dismissNotification('font'));
|
|
},
|
|
onDismissResize: () => {
|
|
dispatch(dismissNotification('resize'));
|
|
},
|
|
onDismissUpdate: () => {
|
|
dispatch(dismissNotification('updates'));
|
|
},
|
|
onUpdateInstall: () => {
|
|
dispatch(installUpdate());
|
|
}
|
|
};
|
|
}
|
|
)(Notifications, 'Notifications');
|
|
|
|
export default NotificationsContainer;
|