mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 12:30:06 +02:00
restructure files onto electron-vite boilerplate
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import isElectron from 'is-electron';
|
||||
import { Platform } from '/@/renderer/types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useWindowSettings, useSettingsStoreActions } from '../../../../store/settings.store';
|
||||
import {
|
||||
SettingsSection,
|
||||
SettingOption,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
|
||||
import { useSettingsStoreActions, useWindowSettings } from '../../../../store/settings.store';
|
||||
|
||||
import { Select, Switch, toast } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { Platform } from '/@/renderer/types';
|
||||
|
||||
const WINDOW_BAR_OPTIONS = [
|
||||
{ label: 'Web (hidden)', value: Platform.WEB },
|
||||
@@ -15,7 +17,7 @@ const WINDOW_BAR_OPTIONS = [
|
||||
{ label: 'Native', value: Platform.LINUX },
|
||||
];
|
||||
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
export const WindowSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -28,7 +30,6 @@ export const WindowSettings = () => {
|
||||
<Select
|
||||
data={WINDOW_BAR_OPTIONS}
|
||||
disabled={!isElectron()}
|
||||
value={settings.windowBarStyle}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
|
||||
@@ -49,7 +50,7 @@ export const WindowSettings = () => {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
onClose: () => {
|
||||
window.electron.ipc!.send('app-restart');
|
||||
window.api.ipc!.send('app-restart');
|
||||
},
|
||||
title: t('common.restartRequired', {
|
||||
postProcess: 'sentenceCase',
|
||||
@@ -72,6 +73,7 @@ export const WindowSettings = () => {
|
||||
},
|
||||
});
|
||||
}}
|
||||
value={settings.windowBarStyle}
|
||||
/>
|
||||
),
|
||||
description: t('setting.windowBarStyle', {
|
||||
|
||||
Reference in New Issue
Block a user