use window maximize

This commit is contained in:
fmtabbara
2022-02-24 09:51:38 +00:00
parent ec5ef1db56
commit 7941b7099f
2 changed files with 7 additions and 5 deletions
+2 -5
View File
@@ -1,6 +1,5 @@
import React, { useContext, useEffect, useLayoutEffect } from 'react'
import ReactDOM from 'react-dom'
import { appWindow, LogicalSize } from '@tauri-apps/api/window'
import { ErrorBoundary } from 'react-error-boundary'
import { BrowserRouter as Router } from 'react-router-dom'
import { Routes } from './routes'
@@ -10,15 +9,13 @@ import { Admin, Welcome } from './pages'
import { ErrorFallback } from './components'
import { NymWalletTheme, WelcomeTheme } from './theme'
import { Settings } from './pages'
import { maximizeWindow } from './utils'
const App = () => {
const { clientDetails } = useContext(ClientContext)
const setWindowSize = async () => {
await appWindow.setSize(new LogicalSize(screen.width, screen.height))
}
useLayoutEffect(() => {
setWindowSize()
maximizeWindow()
}, [])
return !clientDetails ? (
+5
View File
@@ -1,4 +1,5 @@
import { invoke } from '@tauri-apps/api'
import { appWindow } from '@tauri-apps/api/window'
import bs58 from 'bs58'
import { minor, valid } from 'semver'
import { userBalance, majorToMinor, getGasFee } from '../requests'
@@ -124,3 +125,7 @@ export const currencyMap = (network: Network) => {
return currency
}
export const maximizeWindow = async () => {
await appWindow.maximize()
}