mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-25 03:46:29 +02:00
restructure files onto electron-vite boilerplate
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { closeAllModals, openModal } from '@mantine/modals';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, ConfirmModal, toast } from '/@/renderer/components';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Button, ConfirmModal, toast } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
|
||||
const browser = isElectron() ? window.electron.browser : null;
|
||||
const browser = isElectron() ? window.api.browser : null;
|
||||
|
||||
export const CacheSettings = () => {
|
||||
const [isClearing, setIsClearing] = useState(false);
|
||||
@@ -59,8 +60,8 @@ export const CacheSettings = () => {
|
||||
<Button
|
||||
compact
|
||||
disabled={isClearing}
|
||||
variant="filled"
|
||||
onClick={() => openResetConfirmModal(false)}
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.clear', { postProcess: 'sentenceCase' })}
|
||||
</Button>
|
||||
@@ -76,8 +77,8 @@ export const CacheSettings = () => {
|
||||
<Button
|
||||
compact
|
||||
disabled={isClearing}
|
||||
variant="filled"
|
||||
onClick={() => openResetConfirmModal(true)}
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.clear', { postProcess: 'sentenceCase' })}
|
||||
</Button>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { NumberInput, Switch, TextInput } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
@@ -6,10 +8,9 @@ import {
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import {
|
||||
useDiscordSetttings,
|
||||
useSettingsStoreActions,
|
||||
useGeneralSettings,
|
||||
useSettingsStoreActions,
|
||||
} from '/@/renderer/store';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const DiscordSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -75,7 +76,6 @@ export const DiscordSettings = () => {
|
||||
{
|
||||
control: (
|
||||
<NumberInput
|
||||
value={settings.updateInterval}
|
||||
onChange={(e) => {
|
||||
let value = e ? Number(e) : 0;
|
||||
if (value < 15) {
|
||||
@@ -89,6 +89,7 @@ export const DiscordSettings = () => {
|
||||
},
|
||||
});
|
||||
}}
|
||||
value={settings.updateInterval}
|
||||
/>
|
||||
),
|
||||
description: t('setting.discordUpdateInterval', {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { SelectItem } from '@mantine/core';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSettingsStoreActions, useGeneralSettings } from '../../../../store/settings.store';
|
||||
import {
|
||||
SettingsSection,
|
||||
SettingOption,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { Select } from '/@/renderer/components';
|
||||
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '../../../../store/settings.store';
|
||||
|
||||
import { Select } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
const PASSWORD_SETTINGS: SelectItem[] = [
|
||||
{ label: 'libsecret', value: 'gnome_libsecret' },
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useWindowSettings, useSettingsStoreActions } from '../../../../store/settings.store';
|
||||
import {
|
||||
SettingsSection,
|
||||
SettingOption,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { Switch } from '/@/renderer/components';
|
||||
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
const utils = isElectron() ? window.electron.utils : null;
|
||||
import { useSettingsStoreActions, useWindowSettings } from '../../../../store/settings.store';
|
||||
|
||||
import { Switch } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
const utils = isElectron() ? window.api.utils : null;
|
||||
|
||||
export const UpdateSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -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', {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Stack } from '@mantine/core';
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
import { DiscordSettings } from '/@/renderer/features/settings/components/window/discord-settings';
|
||||
import { PasswordSettings } from '/@/renderer/features/settings/components/window/password-settings';
|
||||
import { UpdateSettings } from '/@/renderer/features/settings/components/window/update-settings';
|
||||
import { WindowSettings } from '/@/renderer/features/settings/components/window/window-settings';
|
||||
import { DiscordSettings } from '/@/renderer/features/settings/components/window/discord-settings';
|
||||
import isElectron from 'is-electron';
|
||||
import { PasswordSettings } from '/@/renderer/features/settings/components/window/password-settings';
|
||||
|
||||
const utils = isElectron() ? window.electron.utils : null;
|
||||
const utils = isElectron() ? window.api.utils : null;
|
||||
|
||||
export const WindowTab = () => {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user