feat: quick n dirty fullscreen
This commit is contained in:
parent
902adc9de2
commit
a96a0293e4
|
@ -32,7 +32,9 @@ module.exports = {
|
|||
}],
|
||||
}),
|
||||
mocha(),
|
||||
node(),
|
||||
node({
|
||||
hot: true,
|
||||
}),
|
||||
(neutrino) => {
|
||||
[
|
||||
'components',
|
||||
|
@ -66,7 +68,7 @@ module.exports = {
|
|||
}]);
|
||||
neutrino.config
|
||||
.entry('index')
|
||||
.prepend('@latus/core/start');
|
||||
.add('@latus/core/start');
|
||||
if ('production' !== neutrino.config.get('mode')) {
|
||||
neutrino.config
|
||||
.entry('index')
|
||||
|
@ -75,6 +77,7 @@ module.exports = {
|
|||
.plugin('start-server')
|
||||
.tap((args) => {
|
||||
const options = args[0];
|
||||
options.signal = true;
|
||||
const inspectArg = process.argv.find((arg) => -1 !== arg.indexOf('--inspect'));
|
||||
if (inspectArg) {
|
||||
options.nodeArgs.push(inspectArg);
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
"react-hot-loader": "4.13.0",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"screenfull": "^5.1.0",
|
||||
"source-map-loader": "^1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -2,6 +2,7 @@ import './ui.scss';
|
|||
|
||||
import PropTypes from 'prop-types';
|
||||
import React, {useEffect, useRef} from 'react';
|
||||
import screenfull from 'screenfull';
|
||||
|
||||
const Ui = ({children, width, height}) => {
|
||||
const $ui = useRef();
|
||||
|
@ -39,6 +40,17 @@ const Ui = ({children, width, height}) => {
|
|||
}}
|
||||
>
|
||||
{children}
|
||||
<button
|
||||
className="fullscreen"
|
||||
onClick={() => {
|
||||
if (screenfull.isEnabled) {
|
||||
screenfull.toggle();
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
Fullscreen
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -8753,6 +8753,11 @@ schemapack@^1.4.2:
|
|||
resolved "http://npm.cha0sdev/schemapack/-/schemapack-1.4.2.tgz#8b582a55e128e345854ce3fb380371c58264f349"
|
||||
integrity sha1-i1gqVeEo40WFTOP7OANxxYJk80k=
|
||||
|
||||
screenfull@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "http://npm.cha0sdev/screenfull/-/screenfull-5.1.0.tgz#85c13c70f4ead4c1b8a935c70010dfdcd2c0e5c8"
|
||||
integrity sha512-dYaNuOdzr+kc6J6CFcBrzkLCfyGcMg+gWkJ8us93IQ7y1cevhQAugFsaCdMHb6lw8KV3xPzSxzH7zM1dQap9mA==
|
||||
|
||||
scss-tokenizer@^0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "http://npm.cha0sdev/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1"
|
||||
|
|
Loading…
Reference in New Issue
Block a user