restructure files onto electron-vite boilerplate

This commit is contained in:
jeffvli 2025-05-18 14:03:18 -07:00
parent 91ce2cd8a1
commit 1cf587bc8f
457 changed files with 9927 additions and 11705 deletions

View file

@ -1,16 +1,17 @@
import { useMemo, useEffect } from 'react';
import { Center } from '@mantine/core';
import isElectron from 'is-electron';
import { useEffect, useMemo } from 'react';
import { Navigate, Outlet } from 'react-router-dom';
import { AppRoute } from '/@/renderer/router/routes';
import { useCurrentServer, useSetPlayerFallback } from '/@/renderer/store';
import { Spinner, toast } from '/@/renderer/components';
import { useServerAuthenticated } from '/@/renderer/hooks/use-server-authenticated';
import { AppRoute } from '/@/renderer/router/routes';
import { useCurrentServer, useSetPlayerFallback } from '/@/renderer/store';
import { AuthState } from '/@/renderer/types';
const ipc = isElectron() ? window.electron.ipc : null;
const utils = isElectron() ? window.electron.utils : null;
const mpvPlayerListener = isElectron() ? window.electron.mpvPlayerListener : null;
const ipc = isElectron() ? window.api.ipc : null;
const utils = isElectron() ? window.api.utils : null;
const mpvPlayerListener = isElectron() ? window.api.mpvPlayerListener : null;
export const AppOutlet = () => {
const currentServer = useCurrentServer();

View file

@ -1,14 +1,16 @@
import { ModalsProvider } from '@mantine/modals';
import { lazy, Suspense } from 'react';
import { Route, HashRouter, Routes } from 'react-router-dom';
import { HashRouter, Route, Routes } from 'react-router-dom';
import { AppRoute } from './routes';
import { BaseContextModal } from '/@/renderer/components';
import ArtistListRoute from '/@/renderer/features/artists/routes/artist-list-route';
import { AddToPlaylistContextModal } from '/@/renderer/features/playlists';
import { ShareItemContextModal } from '/@/renderer/features/sharing';
import { DefaultLayout } from '/@/renderer/layouts';
import { AppOutlet } from '/@/renderer/router/app-outlet';
import { TitlebarOutlet } from '/@/renderer/router/titlebar-outlet';
import { ModalsProvider } from '@mantine/modals';
import { BaseContextModal } from '/@/renderer/components';
import { AddToPlaylistContextModal } from '/@/renderer/features/playlists';
import { ShareItemContextModal } from '/@/renderer/features/sharing';
import ArtistListRoute from '/@/renderer/features/artists/routes/artist-list-route';
const NowPlayingRoute = lazy(
() => import('/@/renderer/features/now-playing/routes/now-playing-route'),
@ -96,9 +98,9 @@ export const AppRouter = () => {
>
<Route element={<DefaultLayout />}>
<Route
index
element={<HomeRoute />}
errorElement={<RouteErrorBoundary />}
index
/>
<Route
element={<HomeRoute />}
@ -122,9 +124,9 @@ export const AppRouter = () => {
/>
<Route path={AppRoute.LIBRARY_GENRES}>
<Route
index
element={<GenreListRoute />}
errorElement={<RouteErrorBoundary />}
index
/>
<Route
element={<AlbumListRoute />}
@ -152,8 +154,8 @@ export const AppRouter = () => {
/>
<Route path={AppRoute.LIBRARY_ARTISTS_DETAIL}>
<Route
index
element={<AlbumArtistDetailRoute />}
index
/>
<Route
element={<AlbumListRoute />}
@ -193,13 +195,13 @@ export const AppRouter = () => {
path={AppRoute.LIBRARY_ALBUM_ARTISTS}
>
<Route
index
element={<AlbumArtistListRoute />}
index
/>
<Route path={AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL}>
<Route
index
element={<AlbumArtistDetailRoute />}
index
/>
<Route
element={<AlbumListRoute />}

View file

@ -3,13 +3,13 @@ export enum AppRoute {
EXPLORE = '/explore',
FAKE_LIBRARY_ALBUM_DETAILS = '/library/albums/dummy/:albumId',
HOME = '/',
LIBRARY_ALBUMS = '/library/albums',
LIBRARY_ALBUMS_DETAIL = '/library/albums/:albumId',
LIBRARY_ALBUM_ARTISTS = '/library/album-artists',
LIBRARY_ALBUM_ARTISTS_DETAIL = '/library/album-artists/:albumArtistId',
LIBRARY_ALBUM_ARTISTS_DETAIL_DISCOGRAPHY = '/library/album-artists/:albumArtistId/discography',
LIBRARY_ALBUM_ARTISTS_DETAIL_SONGS = '/library/album-artists/:albumArtistId/songs',
LIBRARY_ALBUM_ARTISTS_DETAIL_TOP_SONGS = '/library/album-artists/:albumArtistId/top-songs',
LIBRARY_ALBUMS = '/library/albums',
LIBRARY_ALBUMS_DETAIL = '/library/albums/:albumId',
LIBRARY_ARTISTS = '/library/artists',
LIBRARY_ARTISTS_DETAIL = '/library/artists/:artistId',
LIBRARY_ARTISTS_DETAIL_DISCOGRAPHY = '/library/artists/:artistId/discography',

View file

@ -1,5 +1,6 @@
import { Outlet } from 'react-router';
import styled from 'styled-components';
import { Titlebar } from '/@/renderer/features/titlebar/components/titlebar';
import { useWindowSettings } from '/@/renderer/store/settings.store';
import { Platform } from '/@/renderer/types';