master
Atul R 5 years ago
parent 491eb65025
commit d20de06faa
  1. 1
      package.json
  2. 7
      src/index.tsx
  3. 1
      tsconfig.json
  4. 5
      yarn.lock

@ -15,6 +15,7 @@
"react": "^16.8.6" "react": "^16.8.6"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^12.6.8",
"@types/react": "^16.8.23", "@types/react": "^16.8.23",
"typescript": "^3.5.3" "typescript": "^3.5.3"
} }

@ -2,17 +2,18 @@ import { Renderer, View, Text, Button, Window } from "@nodegui/react-desktop";
import React, { useState } from "react"; import React, { useState } from "react";
const App = () => { const App = () => {
const [time, setTime] = useState(`${new Date()}`); const [time, setTime] = useState(new Date());
return ( return (
<Window minSize={{ width: 500, height: 200 }} styleSheet={styleSheet}> <Window minSize={{ width: 500, height: 200 }} styleSheet={styleSheet}>
<View id="container"> <View id="container">
<Button <Button
text="Update Time" text="Update Time"
on={{ on={{
clicked: () => setTime(`${new Date()}`) clicked: () => setTime(new Date())
}} }}
/> />
<Text id="result">{time}</Text> <Text id="result">{`${time}`}</Text>
<Text id="result">{`Time in epoc: ${time.getTime()}`}</Text>
</View> </View>
</Window> </Window>
); );

@ -7,6 +7,7 @@
"checkJs": false, "checkJs": false,
"jsx": "react", "jsx": "react",
"outDir": "./dist", "outDir": "./dist",
"sourceMap": true,
"strict": true, "strict": true,
"alwaysStrict": true, "alwaysStrict": true,
"moduleResolution": "node", "moduleResolution": "node",

@ -41,6 +41,11 @@
dependencies: dependencies:
defer-to-connect "^1.0.1" defer-to-connect "^1.0.1"
"@types/node@^12.6.8":
version "12.6.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c"
integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==
"@types/prop-types@*": "@types/prop-types@*":
version "15.7.1" version "15.7.1"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6"

Loading…
Cancel
Save