mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Change TS import baseUrl
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
// import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
// import { App } from 'renderer/app';
|
import { App } from '../renderer/app';
|
||||||
|
|
||||||
describe('App', () => {
|
describe('App', () => {
|
||||||
// eslint-disable-next-line jest/no-commented-out-tests
|
it('should render', () => {
|
||||||
// it('should render', () => {
|
expect(render(<App />)).toBeTruthy();
|
||||||
// expect(render(<App />)).toBeTruthy();
|
});
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { api } from 'renderer/lib';
|
import { api } from '../lib';
|
||||||
import { AlbumsResponse, BasePaginationRequest } from './types';
|
import { AlbumsResponse, BasePaginationRequest } from './types';
|
||||||
|
|
||||||
export interface AlbumsRequest extends BasePaginationRequest {
|
export interface AlbumsRequest extends BasePaginationRequest {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { api } from 'renderer/lib';
|
import { api } from '../lib';
|
||||||
|
|
||||||
const getServers = async () => {
|
const getServers = async () => {
|
||||||
const { data } = await api.get<any[]>('/servers');
|
const { data } = await api.get<any[]>('/servers');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { api } from 'renderer/lib';
|
import { api } from '../lib';
|
||||||
import { UserResponse } from './types';
|
import { UserResponse } from './types';
|
||||||
|
|
||||||
const getUsers = async () => {
|
const getUsers = async () => {
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ interface AudioPlayerProps extends ReactPlayerProps {
|
|||||||
crossfadeDuration: number;
|
crossfadeDuration: number;
|
||||||
crossfadeStyle: CrossfadeStyle;
|
crossfadeStyle: CrossfadeStyle;
|
||||||
currentPlayer: 1 | 2;
|
currentPlayer: 1 | 2;
|
||||||
|
playbackStyle: PlaybackStyle;
|
||||||
player1: Song;
|
player1: Song;
|
||||||
player2: Song;
|
player2: Song;
|
||||||
status: PlayerStatus;
|
status: PlayerStatus;
|
||||||
style: PlaybackStyle;
|
|
||||||
volume: number;
|
volume: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ export const AudioPlayer = forwardRef(
|
|||||||
(
|
(
|
||||||
{
|
{
|
||||||
status,
|
status,
|
||||||
style,
|
playbackStyle,
|
||||||
crossfadeStyle,
|
crossfadeStyle,
|
||||||
crossfadeDuration,
|
crossfadeDuration,
|
||||||
currentPlayer,
|
currentPlayer,
|
||||||
@@ -161,7 +161,9 @@ export const AudioPlayer = forwardRef(
|
|||||||
width={0}
|
width={0}
|
||||||
onEnded={handleOnEnded}
|
onEnded={handleOnEnded}
|
||||||
onProgress={
|
onProgress={
|
||||||
style === PlaybackStyle.Gapless ? handleGapless1 : handleCrossfade1
|
playbackStyle === PlaybackStyle.Gapless
|
||||||
|
? handleGapless1
|
||||||
|
: handleCrossfade1
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<ReactPlayer
|
<ReactPlayer
|
||||||
@@ -175,7 +177,9 @@ export const AudioPlayer = forwardRef(
|
|||||||
width={0}
|
width={0}
|
||||||
onEnded={handleOnEnded}
|
onEnded={handleOnEnded}
|
||||||
onProgress={
|
onProgress={
|
||||||
style === PlaybackStyle.Gapless ? handleGapless2 : handleCrossfade2
|
playbackStyle === PlaybackStyle.Gapless
|
||||||
|
? handleGapless2
|
||||||
|
: handleCrossfade2
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import {
|
|||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Font } from 'renderer/styles';
|
import { Font } from '../../styles';
|
||||||
import { textEllipsis } from 'renderer/styles/mixins';
|
import { textEllipsis } from '../../styles/mixins';
|
||||||
|
|
||||||
type MantineTextDivProps = MantineTextProps & ComponentPropsWithoutRef<'div'>;
|
type MantineTextDivProps = MantineTextProps & ComponentPropsWithoutRef<'div'>;
|
||||||
type MantineTextLinkProps = MantineTextProps & ComponentPropsWithRef<'link'>;
|
type MantineTextLinkProps = MantineTextProps & ComponentPropsWithRef<'link'>;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Card, Skeleton } from '@mantine/core';
|
import { Card, Skeleton } from '@mantine/core';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { CardRow } from 'renderer/types';
|
import { CardRow } from '../../types';
|
||||||
import { Text } from '../text/Text';
|
import { Text } from '../text/Text';
|
||||||
import { GridCardControls } from './GridCardControls';
|
import { GridCardControls } from './GridCardControls';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { UnstyledButton, UnstyledButtonProps } from '@mantine/core';
|
import { UnstyledButton, UnstyledButtonProps } from '@mantine/core';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
import { RiPlayFill } from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { PlayerPlay } from 'tabler-icons-react';
|
|
||||||
|
|
||||||
type PlayButtonType = UnstyledButtonProps &
|
type PlayButtonType = UnstyledButtonProps &
|
||||||
React.ComponentPropsWithoutRef<'button'>;
|
React.ComponentPropsWithoutRef<'button'>;
|
||||||
@@ -81,7 +81,7 @@ export const GridCardControls = ({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<PlayerPlay />
|
<RiPlayFill size={25} />
|
||||||
</PlayButton>
|
</PlayButton>
|
||||||
</CenterControls>
|
</CenterControls>
|
||||||
<BottomControls />
|
<BottomControls />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Ref, useMemo } from 'react';
|
import { Ref, useMemo } from 'react';
|
||||||
import { FixedSizeList, FixedSizeListProps } from 'react-window';
|
import { FixedSizeList, FixedSizeListProps } from 'react-window';
|
||||||
import { usePlayQueueHandler } from 'renderer/features/player/hooks/usePlayQueueHandler';
|
import { usePlayQueueHandler } from '../../features/player/hooks/usePlayQueueHandler';
|
||||||
import { CardRow } from 'renderer/types';
|
import { CardRow } from '../../types';
|
||||||
import { GridCard } from './GridCard';
|
import { GridCard } from './GridCard';
|
||||||
|
|
||||||
export const VirtualGridWrapper = ({
|
export const VirtualGridWrapper = ({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef, useMemo } from 'react';
|
|||||||
import debounce from 'lodash/debounce';
|
import debounce from 'lodash/debounce';
|
||||||
import { FixedSizeListProps } from 'react-window';
|
import { FixedSizeListProps } from 'react-window';
|
||||||
import InfiniteLoader from 'react-window-infinite-loader';
|
import InfiniteLoader from 'react-window-infinite-loader';
|
||||||
import { CardRow } from 'renderer/types';
|
import { CardRow } from '../../types';
|
||||||
import { VirtualGridWrapper } from './VirtualGridWrapper';
|
import { VirtualGridWrapper } from './VirtualGridWrapper';
|
||||||
|
|
||||||
interface VirtualGridProps
|
interface VirtualGridProps
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { useMutation, useQuery } from 'react-query';
|
import { useMutation, useQuery } from 'react-query';
|
||||||
import { authApi } from 'renderer/api/authApi';
|
import { authApi } from '../../../api/authApi';
|
||||||
import { queryKeys } from 'renderer/api/queryKeys';
|
import { queryKeys } from '../../../api/queryKeys';
|
||||||
import { useAuthStore } from 'renderer/store';
|
import { useAuthStore } from '../../../store';
|
||||||
|
|
||||||
export const useLogin = (
|
export const useLogin = (
|
||||||
serverUrl: string,
|
serverUrl: string,
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import { useQuery } from 'react-query';
|
|
||||||
import { authApi } from 'renderer/api/authApi';
|
|
||||||
import { queryKeys } from 'renderer/api/queryKeys';
|
|
||||||
|
|
||||||
export const usePingServer = (server: string) => {
|
|
||||||
return useQuery({
|
|
||||||
enabled: !!server,
|
|
||||||
queryFn: () => authApi.ping(server),
|
|
||||||
queryKey: queryKeys.ping(server),
|
|
||||||
retry: false,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -12,7 +12,7 @@ import { useDebouncedValue } from '@mantine/hooks';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { RiCheckboxCircleFill } from 'react-icons/ri';
|
import { RiCheckboxCircleFill } from 'react-icons/ri';
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
import { normalizeServerUrl } from 'renderer/utils';
|
import { normalizeServerUrl } from '../../../utils';
|
||||||
import { useLogin, usePingServer } from '../queries/login';
|
import { useLogin, usePingServer } from '../queries/login';
|
||||||
import styles from './LoginRoute.module.scss';
|
import styles from './LoginRoute.module.scss';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { Link, LinkProps } from 'react-router-dom';
|
import { Link, LinkProps } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { fontGotham } from 'renderer/styles';
|
import { fontGotham } from '../../../styles';
|
||||||
|
|
||||||
interface LibraryTabProps extends LinkProps {
|
interface LibraryTabProps extends LinkProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import { useState } from 'react';
|
|||||||
import { Button, Group, Menu } from '@mantine/core';
|
import { Button, Group, Menu } from '@mantine/core';
|
||||||
import { useSetState } from '@mantine/hooks';
|
import { useSetState } from '@mantine/hooks';
|
||||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
import i18n from 'i18n/i18n';
|
import i18n from '../../../../i18n/i18n';
|
||||||
import { albumsApi } from 'renderer/api/albumsApi';
|
import { Item } from '../../../../types';
|
||||||
import { VirtualInfiniteGrid } from 'renderer/components/virtual-grid/VirtualInfiniteGrid';
|
import { albumsApi } from '../../../api/albumsApi';
|
||||||
import { AnimatedPage } from 'renderer/features/shared/components/AnimatedPage';
|
import { VirtualInfiniteGrid } from '../../../components/virtual-grid/VirtualInfiniteGrid';
|
||||||
import { AppRoute } from 'renderer/router/utils/routes';
|
import { AppRoute } from '../../../router/utils/routes';
|
||||||
import { Item } from 'types';
|
import { AnimatedPage } from '../../shared/components/AnimatedPage';
|
||||||
import { ViewType, ViewTypeButton } from '../components/ViewTypeButton';
|
import { ViewType, ViewTypeButton } from '../components/ViewTypeButton';
|
||||||
import { useAlbums } from '../queries/getAlbums';
|
import { useAlbums } from '../queries/getAlbums';
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
/* eslint-disable no-plusplus */
|
/* eslint-disable no-plusplus */
|
||||||
import { useRef } from 'react';
|
import { AnimatedPage } from '../../shared/components/AnimatedPage';
|
||||||
import InfiniteLoader from 'react-window-infinite-loader';
|
|
||||||
import { AnimatedPage } from 'renderer/features/shared/components/AnimatedPage';
|
|
||||||
import { useAlbums } from '../queries/getAlbums';
|
import { useAlbums } from '../queries/getAlbums';
|
||||||
|
|
||||||
export const LibraryArtistsRoute = () => {
|
export const LibraryArtistsRoute = () => {
|
||||||
const infiniteLoaderRef = useRef<InfiniteLoader>(null);
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
orderBy: 'asc',
|
orderBy: 'asc',
|
||||||
sortBy: 'title',
|
sortBy: 'title',
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: albums } = useAlbums({
|
const { data: albums } = useAlbums({
|
||||||
limit: 0,
|
skip: 0,
|
||||||
page: 0,
|
take: 0,
|
||||||
...params,
|
...params,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <AnimatedPage />;
|
return <AnimatedPage>Temp</AnimatedPage>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { AnimatedPage } from 'renderer/features/shared/components/AnimatedPage';
|
import { AppRoute } from '../../../router/utils/routes';
|
||||||
import { AppRoute } from 'renderer/router/utils/routes';
|
import { AnimatedPage } from '../../shared/components/AnimatedPage';
|
||||||
import LibraryTab from '../components/LibraryTab';
|
import LibraryTab from '../components/LibraryTab';
|
||||||
|
|
||||||
const TabContainer = styled.div`
|
const TabContainer = styled.div`
|
||||||
|
|||||||
@@ -2,18 +2,18 @@ import { useEffect, useMemo, useState } from 'react';
|
|||||||
import format from 'format-duration';
|
import format from 'format-duration';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
RiPlayFill,
|
|
||||||
RiSkipForwardFill,
|
|
||||||
RiSkipBackFill,
|
|
||||||
RiSpeedFill,
|
|
||||||
RiRewindFill,
|
|
||||||
RiPauseFill,
|
RiPauseFill,
|
||||||
|
RiPlayFill,
|
||||||
|
RiRewindFill,
|
||||||
|
RiSkipBackFill,
|
||||||
|
RiSkipForwardFill,
|
||||||
|
RiSpeedFill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Text } from 'renderer/components';
|
import { PlaybackType, PlayerStatus } from '../../../../types';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { Text } from '../../../components';
|
||||||
import { Font } from 'renderer/styles';
|
import { usePlayerStore } from '../../../store';
|
||||||
import { PlaybackType, PlayerStatus } from 'types';
|
import { Font } from '../../../styles';
|
||||||
import { useCenterControls } from '../hooks/useCenterControls';
|
import { useCenterControls } from '../hooks/useCenterControls';
|
||||||
import { PlayerButton } from './PlayerButton';
|
import { PlayerButton } from './PlayerButton';
|
||||||
import { Slider } from './Slider';
|
import { Slider } from './Slider';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { LazyLoadImage as Image } from 'react-lazy-load-image-component';
|
import { LazyLoadImage as Image } from 'react-lazy-load-image-component';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Text } from 'renderer/components';
|
import { Text } from '../../../components';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { usePlayerStore } from '../../../store';
|
||||||
import { Font } from 'renderer/styles';
|
import { Font } from '../../../styles';
|
||||||
|
|
||||||
const LeftControlsContainer = styled.div`
|
const LeftControlsContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import { Tooltip } from 'renderer/components';
|
import { Tooltip } from '../../../components';
|
||||||
|
|
||||||
type MantineButtonProps = UnstyledButtonProps &
|
type MantineButtonProps = UnstyledButtonProps &
|
||||||
ComponentPropsWithoutRef<'button'>;
|
ComponentPropsWithoutRef<'button'>;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { AudioPlayer } from 'renderer/components';
|
import { PlaybackType } from '../../../../types';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { AudioPlayer } from '../../../components';
|
||||||
import { PlaybackType } from 'types';
|
import { usePlayerStore } from '../../../store';
|
||||||
import { CenterControls } from './CenterControls';
|
import { CenterControls } from './CenterControls';
|
||||||
import { LeftControls } from './LeftControls';
|
import { LeftControls } from './LeftControls';
|
||||||
import { RightControls } from './RightControls';
|
import { RightControls } from './RightControls';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { RiVolumeUpFill, RiVolumeMuteFill } from 'react-icons/ri';
|
import { RiVolumeUpFill, RiVolumeMuteFill } from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { IconButton } from 'renderer/components';
|
import { IconButton } from '../../../components';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { usePlayerStore } from '../../../store';
|
||||||
import { useRightControls } from '../hooks/useRightControls';
|
import { useRightControls } from '../hooks/useRightControls';
|
||||||
import { Slider } from './Slider';
|
import { Slider } from './Slider';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
|
||||||
import { PlaybackType, PlayerStatus } from '../../../../types';
|
import { PlaybackType, PlayerStatus } from '../../../../types';
|
||||||
|
import { usePlayerStore } from '../../../store';
|
||||||
import { mpvPlayer } from '../utils/mpvPlayer';
|
import { mpvPlayer } from '../utils/mpvPlayer';
|
||||||
|
|
||||||
export const useCenterControls = (args: { playersRef: any }) => {
|
export const useCenterControls = (args: { playersRef: any }) => {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { Item, Play } from '../../../../types';
|
||||||
|
import { usePlayerStore } from '../../../store';
|
||||||
import {
|
import {
|
||||||
getJellyfinStreamUrl,
|
getJellyfinStreamUrl,
|
||||||
getServerFolderAuth,
|
getServerFolderAuth,
|
||||||
getSubsonicStreamUrl,
|
getSubsonicStreamUrl,
|
||||||
} from 'renderer/utils';
|
} from '../../../utils';
|
||||||
import { Item, Play } from 'types';
|
|
||||||
import { mpvPlayer } from '../utils/mpvPlayer';
|
import { mpvPlayer } from '../utils/mpvPlayer';
|
||||||
|
|
||||||
const getEndpoint = (item: Item) => {
|
const getEndpoint = (item: Item) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { usePlayerStore } from 'renderer/store';
|
import { usePlayerStore } from '../../../store';
|
||||||
import { mpvPlayer } from '../utils/mpvPlayer';
|
import { mpvPlayer } from '../utils/mpvPlayer';
|
||||||
|
|
||||||
export const useRightControls = () => {
|
export const useRightControls = () => {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const AddServerModal = ({ ...rest }: ModalProps) => {
|
|||||||
const res = await validateServer(values);
|
const res = await validateServer(values);
|
||||||
|
|
||||||
if (res?.token) {
|
if (res?.token) {
|
||||||
createServerMutation.mutateAsync({
|
createServerMutation.mutate({
|
||||||
...values,
|
...values,
|
||||||
remoteUserId: res.userId,
|
remoteUserId: res.userId,
|
||||||
token: res.token,
|
token: res.token,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { useForm } from '@mantine/form';
|
import { useForm } from '@mantine/form';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { ServerResponse } from 'renderer/api/types';
|
import { ServerResponse } from '../../../api/types';
|
||||||
|
|
||||||
interface EditServerModalProps extends ModalProps {
|
interface EditServerModalProps extends ModalProps {
|
||||||
server: ServerResponse | undefined;
|
server: ServerResponse | undefined;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Text } from '@mantine/core';
|
import { Button, Text } from '@mantine/core';
|
||||||
import { useDisclosure } from '@mantine/hooks';
|
import { useDisclosure } from '@mantine/hooks';
|
||||||
import { ServerResponse } from 'renderer/api/types';
|
import { ServerResponse } from '../../../api/types';
|
||||||
import { IconButton } from 'renderer/components';
|
|
||||||
import { useServers } from '../queries/useServers';
|
import { useServers } from '../queries/useServers';
|
||||||
import { EditServerModal } from './EditServerModal';
|
import { EditServerModal } from './EditServerModal';
|
||||||
import styles from './ServerList.module.scss';
|
import styles from './ServerList.module.scss';
|
||||||
@@ -60,9 +59,7 @@ export const ServerList = () => {
|
|||||||
{server.name}
|
{server.name}
|
||||||
<Text>Hello</Text>
|
<Text>Hello</Text>
|
||||||
</div>
|
</div>
|
||||||
<IconButton onClick={() => editServerHandlers.toggle()}>
|
<Button onClick={() => editServerHandlers.toggle()}>Edit</Button>
|
||||||
Edit
|
|
||||||
</IconButton>
|
|
||||||
</div>
|
</div>
|
||||||
{selectedServer && (
|
{selectedServer && (
|
||||||
<EditServerModal
|
<EditServerModal
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { serversApi } from 'renderer/api/serversApi';
|
import { serversApi } from '../../../api/serversApi';
|
||||||
import { randomString } from 'renderer/utils';
|
import { randomString } from '../../../utils';
|
||||||
|
|
||||||
export const validateServer = async (options: {
|
export const validateServer = async (options: {
|
||||||
legacyAuth: boolean;
|
legacyAuth: boolean;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
import { queryKeys } from 'renderer/api/queryKeys';
|
import { ServerFolderAuth } from '../../../../types';
|
||||||
import { serversApi } from 'renderer/api/serversApi';
|
import { queryKeys } from '../../../api/queryKeys';
|
||||||
import { ServerFolderResponse } from 'renderer/api/types';
|
import { serversApi } from '../../../api/serversApi';
|
||||||
import { ServerFolderAuth } from 'types';
|
import { ServerFolderResponse } from '../../../api/types';
|
||||||
|
|
||||||
export const useServers = () => {
|
export const useServers = () => {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import isElectron from 'is-electron';
|
import isElectron from 'is-electron';
|
||||||
import { PlayerState } from 'renderer/store';
|
|
||||||
import {
|
import {
|
||||||
CrossfadeStyle,
|
CrossfadeStyle,
|
||||||
PlaybackStyle,
|
PlaybackStyle,
|
||||||
PlaybackType,
|
PlaybackType,
|
||||||
PlayerRepeat,
|
PlayerRepeat,
|
||||||
} from 'types';
|
} from '../../../../types';
|
||||||
|
import { PlayerState } from '../../../store';
|
||||||
|
|
||||||
export interface WebSettings {
|
export interface WebSettings {
|
||||||
player: PlayerSettings;
|
player: PlayerSettings;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { Link, LinkProps } from 'react-router-dom';
|
import { Link, LinkProps } from 'react-router-dom';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import { fontInter } from 'renderer/styles';
|
import { fontInter } from '../../../styles';
|
||||||
|
|
||||||
interface ListItemProps {
|
interface ListItemProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
RiSearch2Fill,
|
RiSearch2Fill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { AppRoute } from 'renderer/router/utils/routes';
|
import { AppRoute } from '../../../router/utils/routes';
|
||||||
import { ListItem } from './ListItem';
|
import { ListItem } from './ListItem';
|
||||||
|
|
||||||
const StyledSidebar = styled.div``;
|
const StyledSidebar = styled.div``;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { Group } from '@mantine/core';
|
|||||||
import { RiArrowLeftSLine, RiArrowRightSLine } from 'react-icons/ri';
|
import { RiArrowLeftSLine, RiArrowRightSLine } from 'react-icons/ri';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { IconButton } from 'renderer/components';
|
import { IconButton } from '../../../components';
|
||||||
import { WindowControls } from 'renderer/features/window-controls';
|
import { WindowControls } from '../../window-controls';
|
||||||
|
|
||||||
interface TitlebarProps {
|
interface TitlebarProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { Button, Menu } from '@mantine/core';
|
|||||||
import { useDisclosure } from '@mantine/hooks';
|
import { useDisclosure } from '@mantine/hooks';
|
||||||
import { RiLogoutBoxLine, RiServerFill, RiSettings3Fill } from 'react-icons/ri';
|
import { RiLogoutBoxLine, RiServerFill, RiSettings3Fill } from 'react-icons/ri';
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
import { AddServerModal } from 'renderer/features/servers';
|
import { useAuthStore } from '../../../store';
|
||||||
import { useAuthStore } from 'renderer/store';
|
import { AddServerModal } from '../../servers';
|
||||||
|
|
||||||
export const UserMenu = () => {
|
export const UserMenu = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export * from './UserMenu';
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import { I18nextProvider } from 'react-i18next';
|
import { I18nextProvider } from 'react-i18next';
|
||||||
import { QueryClientProvider } from 'react-query';
|
import { QueryClientProvider } from 'react-query';
|
||||||
import i18n from 'i18n/i18n';
|
import i18n from '../i18n/i18n';
|
||||||
import { App } from './app';
|
import { App } from './app';
|
||||||
import { queryClient } from './lib';
|
import { queryClient } from './lib';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Titlebar } from 'renderer/features/titlebar';
|
import { Titlebar } from '../../features/titlebar';
|
||||||
|
|
||||||
const WindowsTitlebarContainer = styled.div`
|
const WindowsTitlebarContainer = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import { AnimatePresence } from 'framer-motion';
|
|||||||
import { Outlet, useLocation } from 'react-router-dom';
|
import { Outlet, useLocation } from 'react-router-dom';
|
||||||
import * as Space from 'react-spaces';
|
import * as Space from 'react-spaces';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Playerbar } from 'renderer/features/player';
|
import { Playerbar } from '../../features/player';
|
||||||
import { Sidebar } from 'renderer/features/sidebar';
|
import { Sidebar } from '../../features/sidebar';
|
||||||
import { Titlebar } from 'renderer/features/titlebar';
|
import { Titlebar } from '../../features/titlebar';
|
||||||
|
|
||||||
const LayoutContainer = styled(Space.ViewPort)``;
|
const LayoutContainer = styled(Space.ViewPort)``;
|
||||||
|
|
||||||
@@ -22,9 +22,7 @@ const TitlebarContainer = styled(Space.Top)`
|
|||||||
border-bottom: var(--playerbar-border-top);
|
border-bottom: var(--playerbar-border-top);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ContentContainer = styled(Space.Fill)`
|
const ContentContainer = styled(Space.Fill)``;
|
||||||
padding: 1rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const PlayerbarContainer = styled(Space.Bottom)``;
|
const PlayerbarContainer = styled(Space.Bottom)``;
|
||||||
|
|
||||||
@@ -54,7 +52,7 @@ export const DefaultLayout = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutContainer>
|
<LayoutContainer>
|
||||||
<TitlebarContainer size={40}>
|
<TitlebarContainer size={30}>
|
||||||
<Titlebar />
|
<Titlebar />
|
||||||
</TitlebarContainer>
|
</TitlebarContainer>
|
||||||
<Space.Fill>
|
<Space.Fill>
|
||||||
@@ -75,7 +73,7 @@ export const DefaultLayout = () => {
|
|||||||
maximumSize={400}
|
maximumSize={400}
|
||||||
size={300}
|
size={300}
|
||||||
/>
|
/>
|
||||||
<Space.Fill>
|
<Space.Fill scrollable>
|
||||||
<AnimatePresence exitBeforeEnter>
|
<AnimatePresence exitBeforeEnter>
|
||||||
<ContentContainer key={location.pathname}>
|
<ContentContainer key={location.pathname}>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-underscore-dangle */
|
/* eslint-disable no-underscore-dangle */
|
||||||
import Axios from 'axios';
|
import Axios from 'axios';
|
||||||
import { authApi } from 'renderer/api/authApi';
|
import { authApi } from '../api/authApi';
|
||||||
|
|
||||||
export const api = Axios.create({
|
export const api = Axios.create({
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import { LoginRoute } from 'renderer/features/auth';
|
import { LoginRoute } from '../features/auth';
|
||||||
import { DashboardRoute } from 'renderer/features/dashboard';
|
import { DashboardRoute } from '../features/dashboard';
|
||||||
import { LibraryAlbumsRoute } from 'renderer/features/library/routes/LibraryAlbumsRoute';
|
import { LibraryAlbumsRoute } from '../features/library/routes/LibraryAlbumsRoute';
|
||||||
import { LibraryArtistsRoute } from 'renderer/features/library/routes/LibraryArtistsRoute';
|
import { LibraryArtistsRoute } from '../features/library/routes/LibraryArtistsRoute';
|
||||||
import { LibraryRoute } from 'renderer/features/library/routes/LibraryRoute';
|
import { LibraryRoute } from '../features/library/routes/LibraryRoute';
|
||||||
import { ServersRoute } from 'renderer/features/servers';
|
import { ServersRoute } from '../features/servers';
|
||||||
import { AuthLayout, DefaultLayout } from '../layouts';
|
import { AuthLayout, DefaultLayout } from '../layouts';
|
||||||
import { AuthOutlet } from './outlets/AuthOutlet';
|
import { AuthOutlet } from './outlets/AuthOutlet';
|
||||||
import { PrivateOutlet } from './outlets/PrivateOutlet';
|
import { PrivateOutlet } from './outlets/PrivateOutlet';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Navigate, Outlet, useLocation } from 'react-router-dom';
|
import { Navigate, Outlet, useLocation } from 'react-router-dom';
|
||||||
import { useAuthStore } from 'renderer/store';
|
import { useAuthStore } from '../../store';
|
||||||
|
|
||||||
interface AuthOutletProps {
|
interface AuthOutletProps {
|
||||||
redirectTo: string;
|
redirectTo: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Navigate, Outlet, useLocation } from 'react-router-dom';
|
import { Navigate, Outlet, useLocation } from 'react-router-dom';
|
||||||
import { useAuthStore } from 'renderer/store';
|
import { useAuthStore } from '../../store';
|
||||||
|
|
||||||
interface PrivateOutletProps {
|
interface PrivateOutletProps {
|
||||||
redirectTo: string;
|
redirectTo: string;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import create from 'zustand';
|
import create from 'zustand';
|
||||||
import { devtools } from 'zustand/middleware';
|
import { devtools } from 'zustand/middleware';
|
||||||
import { Platform } from 'types';
|
import { Platform } from '../../types';
|
||||||
|
|
||||||
export interface AppState {
|
export interface AppState {
|
||||||
currentPage: {
|
currentPage: {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
import create from 'zustand';
|
import create from 'zustand';
|
||||||
import { devtools } from 'zustand/middleware';
|
import { devtools } from 'zustand/middleware';
|
||||||
import { setLocalStorageSettings } from 'renderer/utils';
|
|
||||||
import {
|
import {
|
||||||
CrossfadeStyle,
|
CrossfadeStyle,
|
||||||
PlaybackStyle,
|
PlaybackStyle,
|
||||||
@@ -10,7 +9,8 @@ import {
|
|||||||
PlayerRepeat,
|
PlayerRepeat,
|
||||||
PlayerStatus,
|
PlayerStatus,
|
||||||
Song,
|
Song,
|
||||||
} from 'types';
|
} from '../../types';
|
||||||
|
import { setLocalStorageSettings } from '../utils';
|
||||||
|
|
||||||
export interface PlayerState {
|
export interface PlayerState {
|
||||||
current: {
|
current: {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Song } from 'renderer/api/types';
|
import { Song } from '../api/types';
|
||||||
// import { ServerFolderAuth } from 'renderer/features/servers';
|
|
||||||
|
|
||||||
export const getJellyfinStreamUrl = (
|
export const getJellyfinStreamUrl = (
|
||||||
auth: any,
|
auth: any,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { ServerFolderAuth } from 'types';
|
import { ServerFolderAuth } from '../../types';
|
||||||
|
|
||||||
export const getServerFolderAuth = (
|
export const getServerFolderAuth = (
|
||||||
serverUrl: string,
|
serverUrl: string,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Song } from 'renderer/api/types';
|
import { Song } from '../api/types';
|
||||||
// import { ServerFolderAuth } from 'renderer/features/servers';
|
|
||||||
|
|
||||||
export const getSubsonicStreamUrl = (
|
export const getSubsonicStreamUrl = (
|
||||||
auth: any,
|
auth: any,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"pretty": true,
|
"pretty": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"baseUrl": "./src",
|
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user