Update App.tsx
This commit is contained in:
parent
b2f4329266
commit
d879be824d
|
|
@ -3,12 +3,14 @@ import './styles/index.css'
|
||||||
import Versions from './components/Versions'
|
import Versions from './components/Versions'
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import GameArea, { Game } from './components/GameArea';
|
import GameArea, { Game } from './components/GameArea';
|
||||||
|
import { Dialog } from './components/Dialog';
|
||||||
|
|
||||||
function App(): JSX.Element {
|
function App(): JSX.Element {
|
||||||
const [games, setGames] = useState<Game[]>([]);
|
const [games, setGames] = useState<Game[]>([]);
|
||||||
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
|
|
||||||
async function getAllGames() {
|
async function getAllGames() {
|
||||||
const data = await window.electron.ipcRenderer.invoke('game:getAll');
|
const data = await window["Umbra"].getGames();
|
||||||
|
|
||||||
console.log(data)
|
console.log(data)
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
@ -22,6 +24,15 @@ function App(): JSX.Element {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<button onClick={() => setShowDialog(true)}>Open</button>
|
||||||
|
{showDialog && (
|
||||||
|
<Dialog
|
||||||
|
showCloseButton={true}
|
||||||
|
onClose={() => setShowDialog(false)}
|
||||||
|
>
|
||||||
|
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam consequuntur, optio qui quas impedit magni eos, provident ducimus recusandae nostrum eius, ratione tempore ex in blanditiis? Accusamus omnis delectus repudiandae.</p>
|
||||||
|
</Dialog>
|
||||||
|
)}
|
||||||
<div className='appWrapper'>
|
<div className='appWrapper'>
|
||||||
<div className="sidebar">
|
<div className="sidebar">
|
||||||
<div style={{ height: '600px' }}></div>
|
<div style={{ height: '600px' }}></div>
|
||||||
|
|
|
||||||
Reference in a new issue