mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
fix all imports for new structure
This commit is contained in:
parent
249eaf89f8
commit
930165d006
291 changed files with 2056 additions and 1894 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { IpcRendererEvent } from 'electron';
|
||||
|
||||
import isElectron from 'is-electron';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import i18n, { languages } from '/@/i18n/i18n';
|
||||
|
|
@ -15,7 +15,7 @@ import {
|
|||
useGeneralSettings,
|
||||
useSettingsStoreActions,
|
||||
} from '/@/renderer/store/settings.store';
|
||||
import { FontType } from '/@/renderer/types';
|
||||
import { FontType } from '/@/shared/types/types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
const ipc = isElectron() ? window.api.ipc : null;
|
||||
|
|
@ -68,12 +68,12 @@ export const ApplicationSettings = () => {
|
|||
const { setSettings } = useSettingsStoreActions();
|
||||
const [localFonts, setLocalFonts] = useState<Font[]>([]);
|
||||
|
||||
const fontList = useMemo(() => {
|
||||
if (fontSettings.custom) {
|
||||
return fontSettings.custom.split(/(\\|\/)/g).pop()!;
|
||||
}
|
||||
return '';
|
||||
}, [fontSettings.custom]);
|
||||
// const fontList = useMemo(() => {
|
||||
// if (fontSettings.custom) {
|
||||
// return fontSettings.custom.split(/(\\|\/)/g).pop()!;
|
||||
// }
|
||||
// return '';
|
||||
// }, [fontSettings.custom]);
|
||||
|
||||
const onFontError = useCallback(
|
||||
(_: IpcRendererEvent, file: string) => {
|
||||
|
|
@ -113,8 +113,9 @@ export const ApplicationSettings = () => {
|
|||
try {
|
||||
// WARNING (Oct 17 2023): while this query is valid for chromium-based
|
||||
// browsers, it is still experimental, and so Typescript will complain
|
||||
// @ts-ignore
|
||||
const status = await navigator.permissions.query({ name: 'local-fonts' });
|
||||
const status = await navigator.permissions.query({
|
||||
name: 'local-fonts' as any,
|
||||
});
|
||||
|
||||
if (status.state === 'denied') {
|
||||
throw new Error(
|
||||
|
|
@ -130,6 +131,7 @@ export const ApplicationSettings = () => {
|
|||
})),
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Failed to get local fonts', error);
|
||||
toast.error({
|
||||
message: t('error.systemFontError', { postProcess: 'sentenceCase' }),
|
||||
});
|
||||
|
|
@ -249,7 +251,6 @@ export const ApplicationSettings = () => {
|
|||
},
|
||||
})
|
||||
}
|
||||
placeholder={fontList}
|
||||
w={300}
|
||||
/>
|
||||
),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
useGeneralSettings,
|
||||
useSettingsStoreActions,
|
||||
} from '/@/renderer/store/settings.store';
|
||||
import { Play } from '/@/renderer/types';
|
||||
import { Play } from '/@/shared/types/types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
import {
|
||||
HomeItem,
|
||||
useGeneralSettings,
|
||||
useSettingsStoreActions,
|
||||
} from '../../../../store/settings.store';
|
||||
|
||||
import { DraggableItems } from '/@/renderer/features/settings/components/general/draggable-items';
|
||||
import { HomeItem, useGeneralSettings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
|
||||
const HOME_ITEMS: Array<[string, string]> = [
|
||||
[HomeItem.RANDOM, 'page.home.explore'],
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
import { ChangeEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '../../../../store/settings.store';
|
||||
|
||||
import { Switch } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
|
||||
export const SidebarSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { THEME_DATA } from '/@/renderer/hooks';
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
import { AppTheme } from '/@/renderer/themes/types';
|
||||
import { AppTheme } from '/@/shared/types/domain-types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export const HotkeyManagerSettings = () => {
|
|||
(binding: BindingActions, e: KeyboardEvent<HTMLInputElement>) => {
|
||||
e.preventDefault();
|
||||
const IGNORED_KEYS = ['Control', 'Alt', 'Shift', 'Meta', ' ', 'Escape'];
|
||||
const keys = [];
|
||||
const keys: string[] = [];
|
||||
if (e.ctrlKey) keys.push('mod');
|
||||
if (e.altKey) keys.push('alt');
|
||||
if (e.shiftKey) keys.push('shift');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import { Stack } from '@mantine/core';
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
import { WindowHotkeySettings } from './window-hotkey-settings';
|
||||
|
||||
import { HotkeyManagerSettings } from '/@/renderer/features/settings/components/hotkeys/hotkey-manager-settings';
|
||||
import { WindowHotkeySettings } from '/@/renderer/features/settings/components/hotkeys/window-hotkey-settings';
|
||||
|
||||
export const HotkeysTab = () => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { SettingOption, SettingsSection } from '../settings-section';
|
||||
|
||||
import { Switch } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useHotkeySettings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import {
|
|||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useCurrentStatus, usePlayerStore } from '/@/renderer/store';
|
||||
import { usePlaybackSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
import { CrossfadeStyle, PlaybackStyle, PlaybackType, PlayerStatus } from '/@/renderer/types';
|
||||
import { setQueue } from '/@/renderer/utils/set-transcoded-queue-data';
|
||||
import { CrossfadeStyle, PlaybackStyle, PlaybackType, PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
const getAudioDevice = async () => {
|
||||
const devices = await navigator.mediaDevices.enumerateDevices();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
|
|||
import styled from 'styled-components';
|
||||
|
||||
import { languages } from '/@/i18n/i18n';
|
||||
import { LyricSource } from '/@/renderer/api/types';
|
||||
import {
|
||||
MultiSelect,
|
||||
MultiSelectProps,
|
||||
|
|
@ -17,6 +16,7 @@ import {
|
|||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useLyricsSettings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
import { LyricSource } from '/@/shared/types/domain-types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
useSettingsStore,
|
||||
useSettingsStoreActions,
|
||||
} from '/@/renderer/store/settings.store';
|
||||
import { PlaybackType } from '/@/renderer/types';
|
||||
import { PlaybackType } from '/@/shared/types/types';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
const mpvPlayer = isElectron() ? window.api.mpvPlayer : null;
|
||||
|
|
@ -127,7 +127,7 @@ export const MpvSettings = () => {
|
|||
|
||||
const extraParameters = useSettingsStore.getState().playback.mpvExtraParameters;
|
||||
const properties: Record<string, any> = {
|
||||
speed: usePlayerStore.getState().current.speed,
|
||||
speed: usePlayerStore.getState().speed,
|
||||
...getMpvProperties(useSettingsStore.getState().playback.mpvProperties),
|
||||
};
|
||||
mpvPlayer?.restart({
|
||||
|
|
@ -162,7 +162,6 @@ export const MpvSettings = () => {
|
|||
</Button>
|
||||
<FileInput
|
||||
onChange={handleSetMpvPath}
|
||||
placeholder={mpvPath}
|
||||
rightSection={
|
||||
mpvPath && (
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { LyricSettings } from '/@/renderer/features/settings/components/playback
|
|||
import { ScrobbleSettings } from '/@/renderer/features/settings/components/playback/scrobble-settings';
|
||||
import { TranscodeSettings } from '/@/renderer/features/settings/components/playback/transcode-settings';
|
||||
import { useSettingsStore } from '/@/renderer/store';
|
||||
import { PlaybackType } from '/@/renderer/types';
|
||||
import { PlaybackType } from '/@/shared/types/types';
|
||||
|
||||
const MpvSettings = lazy(() =>
|
||||
import('/@/renderer/features/settings/components/playback/mpv-settings').then((module) => {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { SettingOption, SettingsSection } from '../settings-section';
|
||||
|
||||
import { NumberInput, Slider, Switch } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { usePlaybackSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
|
||||
export const ScrobbleSettings = () => {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { SettingOption, SettingsSection } from '../settings-section';
|
||||
|
||||
import { NumberInput, Switch, TextInput } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { usePlaybackSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
|
||||
export const TranscodeSettings = () => {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ import { closeAllModals, openModal } from '@mantine/modals';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
import { RiSettings2Fill } from 'react-icons/ri';
|
||||
|
||||
import { useSettingsStoreActions } from '../../../store/settings.store';
|
||||
|
||||
import { Button, ConfirmModal, PageHeader, SearchInput } from '/@/renderer/components';
|
||||
import { useSettingSearchContext } from '/@/renderer/features/settings/context/search-context';
|
||||
import { LibraryHeaderBar } from '/@/renderer/features/shared';
|
||||
import { useContainerQuery } from '/@/renderer/hooks';
|
||||
import { useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
|
||||
export type SettingsHeaderProps = {
|
||||
setSearch: (search: string) => void;
|
||||
|
|
|
|||
|
|
@ -62,8 +62,3 @@ export const SettingsOptions = ({ control, description, note, title }: SettingsO
|
|||
</>
|
||||
);
|
||||
};
|
||||
|
||||
SettingsOptions.defaultProps = {
|
||||
description: undefined,
|
||||
note: undefined,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ import { SelectItem } from '@mantine/core';
|
|||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '../../../../store/settings.store';
|
||||
|
||||
import { Select } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useGeneralSettings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useSettingsStoreActions, useWindowSettings } from '../../../../store/settings.store';
|
||||
|
||||
import { Switch } from '/@/renderer/components';
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useSettingsStoreActions, useWindowSettings } from '/@/renderer/store';
|
||||
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
const utils = isElectron() ? window.api.utils : null;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
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';
|
||||
import { useSettingsStoreActions, useWindowSettings } from '/@/renderer/store';
|
||||
import { Platform } from '/@/shared/types/types';
|
||||
|
||||
const WINDOW_BAR_OPTIONS = [
|
||||
{ label: 'Web (hidden)', value: Platform.WEB },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue