adds workaround for images

master
Atul R 5 years ago
parent 7bb082de23
commit b8756ab420
  1. 1
      extras.d.ts
  2. 7
      src/index.tsx

1
extras.d.ts vendored

@ -0,0 +1 @@
declare module "*.jpg";

@ -8,18 +8,17 @@ import {
useEventHandler useEventHandler
} from "@nodegui/react-nodegui"; } from "@nodegui/react-nodegui";
import React, { useState } from "react"; import React, { useState } from "react";
import { AspectRatioMode } from "@nodegui/nodegui"; import { AspectRatioMode, QPushButtonEvents } from "@nodegui/nodegui";
//@ts-ignore
import imageUrl from "../assets/sample.jpg"; import imageUrl from "../assets/sample.jpg";
const fixedSize = { width: 500, height: 500 }; const fixedSize = { width: 500, height: 500 };
const App = () => { const App = () => {
const [time, setTime] = useState(new Date()); const [time, setTime] = useState(new Date());
const btnHandler = useEventHandler( const btnHandler = useEventHandler(
{ clicked: () => setTime(new Date()) }, { [QPushButtonEvents.clicked]: () => setTime(new Date()) },
[] []
); );
console.log(imageUrl);
return ( return (
<Window minSize={fixedSize} maxSize={fixedSize} styleSheet={styleSheet}> <Window minSize={fixedSize} maxSize={fixedSize} styleSheet={styleSheet}>
<View id="container"> <View id="container">

Loading…
Cancel
Save