You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Renderer, View, Text, Button, Window } from "@nodegui/react-desktop";
|
|
|
|
import React, { useState } from "react";
|
|
|
|
|
|
|
|
const App = () => {
|
|
|
|
const [time, setTime] = useState(new Date());
|
|
|
|
return (
|
|
|
|
<Window minSize={{ width: 500, height: 200 }} styleSheet={styleSheet}>
|
|
|
|
<View id="container">
|
|
|
|
<Button
|
|
|
|
text="Update Time"
|
|
|
|
on={{
|
|
|
|
clicked: () => setTime(new Date())
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Text id="result">{`${time}`}</Text>
|
|
|
|
<Text id="result">{`Time in epoc: ${time.getTime()}`}</Text>
|
|
|
|
</View>
|
|
|
|
</Window>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const styleSheet = `
|
|
|
|
#container {
|
|
|
|
qproperty-flex: 1;
|
|
|
|
qproperty-flexDirection: column;
|
|
|
|
qproperty-minHeight: '100%';
|
|
|
|
qproperty-alignItems: 'center';
|
|
|
|
qproperty-justifyContent: 'center';
|
|
|
|
}
|
|
|
|
#opBtn {
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
#result {
|
|
|
|
font-size: 12px;
|
|
|
|
qproperty-flex: 1;
|
|
|
|
color: cyan;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
Renderer.render(<App />, () => {});
|