Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): fixed visualisation overflow #48

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<title>Tari Universe</title>
<style>
canvas {
visibility: visible;
padding: 0 0 0 200px;
position: absolute;
top: 0;
left: 0;

}
canvas.hidden {
visibility: hidden;
z-index:0;

}
</style>
</head>
<body>
<div id="root"></div>
Expand Down
142 changes: 71 additions & 71 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
{
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420",
"distDir": "../dist"
},
"package": {
"productName": "Tari Universe",
"version": "0.1.27"
},
"tauri": {
"updater": {
"active": true,
"endpoints": [
"https://raw.githubusercontent.com/tari-project/universe/main/.updater/latest.json"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEYxNUJBOEFEQkQ4RjJBMjYKUldRbUtvKzlyYWhiOFJIUmFFditENVV3d3hRbjNlZm1DMi9aMjluRUpVdHhQTytadTV3ODN3bUMK"
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420",
"distDir": "../dist"
},
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true,
"sidecar": false
},
"window": {
"all": false,
"close": true,
"hide": true,
"show": true,
"maximize": true,
"minimize": true,
"unmaximize": true,
"unminimize": true,
"startDragging": true
}
"package": {
"productName": "Tari Universe",
"version": "0.1.27"
},
"pattern": {
"use": "isolation",
"options": {
"dir": "../dist-isolation"
}
},
"windows": [
{
"title": "tari-universe",
"label": "main",
"width": 1200,
"height": 800,
"resizable": true,
"fullscreen": false,
"decorations": false,
"transparent": true
}
],
"security": {
"csp": null
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tari.universe",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
},
"macOSPrivateApi": true
}
"tauri": {
"updater": {
"active": true,
"endpoints": [
"https://raw.githubusercontent.com/tari-project/universe/main/.updater/latest.json"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEYxNUJBOEFEQkQ4RjJBMjYKUldRbUtvKzlyYWhiOFJIUmFFditENVV3d3hRbjNlZm1DMi9aMjluRUpVdHhQTytadTV3ODN3bUMK"
},
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true,
"sidecar": false
},
"window": {
"all": false,
"close": true,
"hide": true,
"show": true,
"maximize": true,
"minimize": true,
"unmaximize": true,
"unminimize": true,
"startDragging": true
}
},
"pattern": {
"use": "isolation",
"options": {
"dir": "../dist-isolation"
}
},
"windows": [
{
"title": "tari-universe",
"label": "main",
"width": 1380,
"height": 780,
"resizable": true,
"fullscreen": false,
"decorations": false,
"transparent": true
}
],
"security": {
"csp": null
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tari.universe",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
},
"macOSPrivateApi": true
}
}
12 changes: 9 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './theme/theme.css';
import { useEffect, useRef } from 'react';
import { CSSProperties, useEffect, useRef } from 'react';
import { invoke } from '@tauri-apps/api/tauri';
import CssBaseline from '@mui/material/CssBaseline';
import { ThemeProvider } from '@mui/material/styles';
Expand All @@ -19,6 +19,7 @@ import { useMining } from './hooks/useMining.ts';

import { useGetApplicatonsVersions } from './hooks/useGetApplicatonsVersions.ts';
import { preload } from './visuals';
import { appBorderRadius } from './theme/tokens.ts';

function App() {
const background = useUIStore((s) => s.background);
Expand Down Expand Up @@ -91,10 +92,15 @@ function App() {
useGetApplicatonsVersions();

const hideCanvas = !visualMode || view === 'setup';

const canvasStyle: CSSProperties = {
visibility: hideCanvas ? 'hidden' : 'visible',
borderRadius: appBorderRadius,
position: 'absolute',
zIndex: '0',
};
return (
<>
<canvas id="canvas" className={hideCanvas ? 'hidden' : undefined} />
<canvas id="canvas" style={canvasStyle} />
<ThemeProvider theme={lightTheme}>
<CssBaseline enableColorScheme />
<AppBackground status={background}>
Expand Down
30 changes: 15 additions & 15 deletions src/containers/TitleBar/TitleBar.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { useState } from 'react'
import { appWindow } from '@tauri-apps/api/window'
import { Stack } from '@mui/material'
import { IoClose, IoRemove } from 'react-icons/io5'
import { RiExpandUpDownFill, RiContractUpDownFill } from 'react-icons/ri'
import { useState } from 'react';
import { appWindow } from '@tauri-apps/api/window';
import { Stack } from '@mui/material';
import { IoClose, IoRemove } from 'react-icons/io5';
import { RiExpandUpDownFill, RiContractUpDownFill } from 'react-icons/ri';
import {
CloseButton,
MinimizeButton,
ToggleButton,
MinMaxStyle,
TitleBarContainer,
} from './styles'
} from './styles';

const TitleBar = () => {
const [isExpanded, setIsExpanded] = useState(false)
const minimize = () => appWindow.minimize()
const close = () => appWindow.close()
const [isExpanded, setIsExpanded] = useState(false);
const minimize = () => appWindow.minimize();
const close = () => appWindow.close();
const toggleMaximize = () => {
setIsExpanded(!isExpanded)
appWindow.toggleMaximize()
}
setIsExpanded(!isExpanded);
appWindow.toggleMaximize();
};

return (
<TitleBarContainer data-tauri-drag-region>
Expand All @@ -44,7 +44,7 @@ const TitleBar = () => {
</ToggleButton>
</Stack>
</TitleBarContainer>
)
}
);
};

export default TitleBar
export default TitleBar;