From 723114261d09cfe6721ef0e1a54f61db23660e71 Mon Sep 17 00:00:00 2001 From: Atul R Date: Sun, 28 Jul 2019 22:30:59 +0200 Subject: [PATCH] Working base boilerplate --- .gitignore | 3 + README.md | 10 + package.json | 21 + src/index.tsx | 41 ++ tsconfig.json | 15 + yarn.lock | 1082 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1172 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 package.json create mode 100644 src/index.tsx create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba6a44d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist/ +*.log \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..700871f --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Dependencies: + +- @nodegui/nodegui +- @nodegui/react-desktop +- react + +# DevDependencies: + +- @nodegui/qode +- typescript diff --git a/package.json b/package.json new file mode 100644 index 0000000..80cbbc7 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "react-desktop-test", + "version": "1.0.0", + "main": "index.js", + "author": "Atul R ", + "license": "MIT", + "private": true, + "scripts": { + "dev": "tsc && qode ./dist/index.js" + }, + "dependencies": { + "@nodegui/nodegui": "^0.0.5-alpha", + "@nodegui/react-desktop": "^0.0.5-alpha", + "@nodegui/test": "^0.0.10", + "react": "^16.8.6" + }, + "devDependencies": { + "@types/react": "^16.8.23", + "typescript": "^3.5.3" + } +} diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..d543d14 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,41 @@ +import { Renderer, View, Text, Button, Window } from "@nodegui/react-desktop"; +import React, { useState, useMemo } from "react"; +import { QPushButtonEvents } from "@nodegui/nodegui"; + +const App = () => { + const [time, setTime] = useState(`${new Date()}`); + const buttonEventHandlers = useMemo( + () => ({ + [QPushButtonEvents.clicked]: () => setTime(`${new Date()}`) + }), + [] + ); + return ( + + +