Rename /context --> /contexts
This commit is contained in:
parent
3e82def76c
commit
728eb185b7
11 changed files with 10 additions and 26 deletions
|
|
@ -1,13 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import { PDFViewer } from '@/components/PDFViewer';
|
||||
import { usePDF } from '@/context/PDFContext';
|
||||
import { usePDF } from '@/contexts/PDFContext';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { PDFSkeleton } from '@/components/PDFSkeleton';
|
||||
import TTSPlayer from '@/components/TTSPlayer';
|
||||
import { useTTS } from '@/context/TTSContext';
|
||||
import { useTTS } from '@/contexts/TTSContext';
|
||||
|
||||
export default function PDFViewerPage() {
|
||||
const { id } = useParams();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import { PDFProvider } from '@/context/PDFContext';
|
||||
import { TTSProvider } from '@/context/TTSContext';
|
||||
import { ThemeProvider } from '@/context/ThemeContext';
|
||||
import { PDFProvider } from '@/contexts/PDFContext';
|
||||
import { TTSProvider } from '@/contexts/TTSContext';
|
||||
import { ThemeProvider } from '@/contexts/ThemeContext';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export function Providers({ children }: { children: ReactNode }) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { usePDF } from '@/context/PDFContext';
|
||||
import { usePDF } from '@/contexts/PDFContext';
|
||||
import Link from 'next/link';
|
||||
import { Dialog } from '@headlessui/react';
|
||||
import { Transition } from '@headlessui/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useDropzone } from 'react-dropzone';
|
||||
import { usePDF } from '@/context/PDFContext';
|
||||
import { usePDF } from '@/contexts/PDFContext';
|
||||
|
||||
interface PDFUploaderProps {
|
||||
className?: string;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import 'react-pdf/dist/Page/AnnotationLayer.css';
|
|||
import 'react-pdf/dist/Page/TextLayer.css';
|
||||
import { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
||||
import { PDFSkeleton } from './PDFSkeleton';
|
||||
import { useTTS } from '@/context/TTSContext';
|
||||
import { useTTS } from '@/contexts/TTSContext';
|
||||
import stringSimilarity from 'string-similarity';
|
||||
import nlp from 'compromise';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { Fragment } from 'react';
|
||||
import { Dialog, Transition, Listbox } from '@headlessui/react';
|
||||
import { useTheme } from '@/context/ThemeContext';
|
||||
import { useTheme } from '@/contexts/ThemeContext';
|
||||
|
||||
interface SettingsModalProps {
|
||||
isOpen: boolean;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { useTTS } from '@/context/TTSContext';
|
||||
import { useTTS } from '@/contexts/TTSContext';
|
||||
import { Button } from '@headlessui/react';
|
||||
import {
|
||||
PlayIcon,
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
// This will be loaded as a module
|
||||
export function initializeTheme() {
|
||||
try {
|
||||
const savedTheme = localStorage.getItem('theme') || 'system';
|
||||
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
const theme = savedTheme === 'system' ? systemTheme : savedTheme;
|
||||
|
||||
document.documentElement.classList.remove('light', 'dark');
|
||||
document.documentElement.classList.add(theme);
|
||||
document.documentElement.style.colorScheme = theme;
|
||||
} catch (e) {
|
||||
// Fallback to light theme if localStorage is not available
|
||||
document.documentElement.classList.add('light');
|
||||
document.documentElement.style.colorScheme = 'light';
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue