Skip to content

Commit 309859f

Browse files
committed
LeftPanel: migrate to Mantine
1 parent 6c900a3 commit 309859f

File tree

9 files changed

+208
-135
lines changed

9 files changed

+208
-135
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = {
1515
rules: {
1616
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
1717
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
18-
"no-only-tests/no-only-tests": "error"
18+
"no-only-tests/no-only-tests": "error",
19+
"@typescript-eslint/no-empty-function": "off"
1920
},
2021
settings: {
2122
react: {

package-lock.json

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@
121121
"@blueprintjs/core": "^5.19.0",
122122
"@blueprintjs/popover2": "^2.1.31",
123123
"@blueprintjs/select": "^5.3.20",
124-
"@mantine/core": "^8.0.2",
125-
"@mantine/form": "^8.0.2",
126-
"@mantine/hooks": "^8.0.2",
127-
"@mantine/modals": "^8.0.2",
124+
"@mantine/core": "^8.1.1",
125+
"@mantine/form": "^8.1.1",
126+
"@mantine/hooks": "^8.1.1",
127+
"@mantine/modals": "^8.1.1",
128128
"@tabler/icons-react": "^3.34.0",
129129
"@tanstack/react-virtual": "^3.13.6",
130130
"@types/mkdirp": "^0.5.2",

src/components/App.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useEffect, useCallback, useState, useRef } from 'react'
22
import { ipcRenderer, webFrame } from 'electron'
33
import { platform } from 'process'
4-
import { Select, TextInput, Radio, AppShell, virtualColor, colorsTuple } from '@mantine/core'
4+
import { Select, TextInput, Radio, AppShell, virtualColor, colorsTuple, Button as ButtonMantine } from '@mantine/core'
55
import { createTheme, MantineProvider } from '@mantine/core'
66
import { ModalsProvider } from '@mantine/modals'
7-
import { FocusStyleManager, Alert, Classes, Intent } from '@blueprintjs/core'
7+
import { FocusStyleManager, Alert, Classes, Intent, Button } from '@blueprintjs/core'
88
import classNames from 'classnames'
99
import { Provider, observer } from 'mobx-react'
1010
import { Trans, useTranslation } from 'react-i18next'
@@ -30,6 +30,7 @@ import '@blueprintjs/core/lib/css/blueprint.css'
3030
// import '@blueprintjs/icons/lib/css/blueprint-icons.css'
3131
// import '@blueprintjs/popover2/lib/css/blueprint-popover2.css'
3232
import '$src/css/main.css'
33+
import '$src/css/mantine-extensions.css'
3334
// import '$src/css/windows.css'
3435
// import '$src/css/scrollbars.css'
3536

@@ -40,13 +41,20 @@ import { PreviewDialog } from './dialogs/PreviewDialog'
4041

4142
const theme = createTheme({
4243
colors: {
43-
['blue-dark']: colorsTuple('#293742'),
44-
['blue-light']: colorsTuple('#ced9e080'),
44+
['blue-background-dark']: colorsTuple('#293742'),
45+
['blue-background-light']: colorsTuple('#ced9e080'),
46+
['gray-light']: colorsTuple('#4a5056'),
47+
['gray-dark']: colorsTuple('#eeeeee'),
4548
background: virtualColor({
46-
light: 'blue-light',
47-
dark: 'blue-dark',
49+
light: 'blue-background-light',
50+
dark: 'blue-background-dark',
4851
name: 'background',
4952
}),
53+
button: virtualColor({
54+
light: 'gray-light',
55+
dark: 'gray-dark',
56+
name: 'button',
57+
}),
5058
},
5159
components: {
5260
Select: Select.extend({
@@ -64,6 +72,11 @@ const theme = createTheme({
6472
label: { paddingBottom: '.2rem' },
6573
},
6674
}),
75+
Button: ButtonMantine.extend({
76+
styles: {
77+
inner: { justifyContent: 'left' },
78+
},
79+
}),
6780
},
6881
})
6982

@@ -316,6 +329,7 @@ const App = observer(() => {
316329
<MantineProvider theme={theme} forceColorScheme={(settingsState.isDarkModeActive && 'dark') || 'light'}>
317330
<ModalsProvider>
318331
<AppShell
332+
transitionDuration={0}
319333
header={{ height: 50 }}
320334
navbar={{
321335
width: 200,
@@ -356,10 +370,9 @@ const App = observer(() => {
356370
</AppShell.Header>
357371
{/* <div onClickCapture={handleClick} onContextMenuCapture={handleClick} className={mainClass}> */}
358372
<AppShell.Navbar>
359-
{/* <LeftPanel hide={!isExplorer} /> */}
360-
Navbar :)
373+
<LeftPanel hide={!isExplorer} />
361374
</AppShell.Navbar>
362-
<AppShell.Main h="100%" flex={1}>
375+
<AppShell.Main h="100%" display={'flex'}>
363376
{<SideView viewState={views[0]} hide={!isExplorer} />}
364377
{splitView && <SideView viewState={views[1]} hide={!isExplorer} />}
365378
<Downloads hide={isExplorer} />

0 commit comments

Comments
 (0)