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

Refactor experimental display preferences structure #5948

Merged
merged 1 commit into from
Aug 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { useApi } from 'hooks/useApi';
import { useThemes } from 'hooks/useThemes';
import globalize from 'lib/globalize';

import { DisplaySettingsValues } from './types';
import { useScreensavers } from './hooks/useScreensavers';
import { useScreensavers } from '../hooks/useScreensavers';
import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface DisplayPreferencesProps {
onChange: (event: SelectChangeEvent | React.SyntheticEvent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Typography from '@mui/material/Typography';
import React from 'react';

import globalize from 'lib/globalize';
import { DisplaySettingsValues } from './types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface ItemDetailPreferencesProps {
onChange: (event: React.SyntheticEvent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import Typography from '@mui/material/Typography';
import React from 'react';

import globalize from 'lib/globalize';
import { DisplaySettingsValues } from './types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface LibraryPreferencesProps {
onChange: (event: React.SyntheticEvent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import React from 'react';

import { DATE_LOCALE_OPTIONS, LANGUAGE_OPTIONS } from 'apps/experimental/features/preferences/constants/locales';
import { appHost } from 'components/apphost';
import datetime from 'scripts/datetime';
import globalize from 'lib/globalize';
import { DATE_LOCALE_OPTIONS, LANGUAGE_OPTIONS } from './constants';
import { DisplaySettingsValues } from './types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface LocalizationPreferencesProps {
onChange: (event: SelectChangeEvent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import Typography from '@mui/material/Typography';
import React from 'react';

import globalize from 'lib/globalize';
import { DisplaySettingsValues } from './types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface NextUpPreferencesProps {
onChange: (event: React.SyntheticEvent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useSearchParams } from 'react-router-dom';

import toast from 'components/toast/toast';
import globalize from 'lib/globalize';
import { DisplaySettingsValues } from '../types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';
import { useDisplaySettings } from './useDisplaySettings';

type UpdateField = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserDto } from '@jellyfin/sdk/lib/generated-client';
import type { UserDto } from '@jellyfin/sdk/lib/generated-client';
import { ApiClient } from 'jellyfin-apiclient';
import { useCallback, useEffect, useState } from 'react';

Expand All @@ -7,7 +7,8 @@ import layoutManager from 'components/layoutManager';
import { useApi } from 'hooks/useApi';
import themeManager from 'scripts/themeManager';
import { currentSettings, UserSettings } from 'scripts/settings/userSettings';
import { DisplaySettingsValues } from '../types';

import type { DisplaySettingsValues } from '../types/displaySettingsValues';

interface UseDisplaySettingsParams {
userId?: string | null;
Expand Down
16 changes: 8 additions & 8 deletions src/apps/experimental/routes/user/display/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { SelectChangeEvent } from '@mui/material/Select';
import Stack from '@mui/material/Stack';
import React, { useCallback } from 'react';

import { DisplayPreferences } from 'apps/experimental/features/preferences/components/DisplayPreferences';
import { ItemDetailPreferences } from 'apps/experimental/features/preferences/components/ItemDetailPreferences';
import { LibraryPreferences } from 'apps/experimental/features/preferences/components/LibraryPreferences';
import { useDisplaySettingForm } from 'apps/experimental/features/preferences/hooks/useDisplaySettingForm';
import { LocalizationPreferences } from 'apps/experimental/features/preferences/components/LocalizationPreferences';
import { NextUpPreferences } from 'apps/experimental/features/preferences/components/NextUpPreferences';
import type { DisplaySettingsValues } from 'apps/experimental/features/preferences/types/displaySettingsValues';
import LoadingComponent from 'components/loading/LoadingComponent';
import Page from 'components/Page';
import globalize from 'lib/globalize';
import { DisplayPreferences } from './DisplayPreferences';
import { ItemDetailPreferences } from './ItemDetailPreferences';
import { LibraryPreferences } from './LibraryPreferences';
import { LocalizationPreferences } from './LocalizationPreferences';
import { NextUpPreferences } from './NextUpPreferences';
import { useDisplaySettingForm } from './hooks/useDisplaySettingForm';
import { DisplaySettingsValues } from './types';
import LoadingComponent from 'components/loading/LoadingComponent';

export default function UserDisplayPreferences() {
const {
Expand Down
Loading