Skip to content

Commit f05c618

Browse files
authored
Merge pull request #16 from nafasebra/main
Merge constant and constants folder and add path alias to project
2 parents 70598b5 + cf54129 commit f05c618

File tree

72 files changed

+197
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+197
-173
lines changed

src/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
22
import { ThemeProvider } from './context/theme.context'
33
import { HomePage } from './pages/home'
4+
45
const queryClient = new QueryClient({
56
defaultOptions: {
67
queries: {

src/common/constant/store.key.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { SelectedCity } from '../../context/weather.context'
2-
import type { Todo } from '../../layouts/calendar/interface/todo.interface'
3-
import type { Bookmark } from '../../layouts/search/bookmarks/types/bookmark.types'
4-
import type { FetchedCurrency } from '../../services/getMethodHooks/getCurrencyByCode.hook'
1+
import type { SelectedCity } from '@/context/weather.context'
2+
import type { Todo } from '@/layouts/calendar/interface/todo.interface'
3+
import type { Bookmark } from '@/layouts/search/bookmarks/types/bookmark.types'
4+
import type { FetchedCurrency } from '@/services/getMethodHooks/getCurrencyByCode.hook'
55
import type {
66
FetchedWeather,
77
WeatherSettings,
8-
} from '../../services/getMethodHooks/weather/weather.interface'
8+
} from '@/services/getMethodHooks/weather/weather.interface'
99
import type { StoredWallpaper, Wallpaper } from '../wallpaper.interface'
1010

1111
export interface StorageKV {
File renamed without changes.

src/components/UpdateReleaseNotesModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from 'framer-motion'
22
import { RiBug2Line, RiCheckboxCircleFill, RiStarLine, RiToolsLine } from 'react-icons/ri'
3-
import { useTheme } from '../context/theme.context'
3+
import { useTheme } from '@/context/theme.context'
44
import Modal from './modal'
55

66
type ReleaseNotes = Record<

src/components/checkbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from 'framer-motion'
22
import { memo } from 'react'
3-
import { useTheme } from '../context/theme.context'
3+
import { useTheme } from '@/context/theme.context'
44

55
interface CustomCheckboxProps {
66
checked: boolean

src/components/extension-installed-modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from 'framer-motion'
22
import { useState } from 'react'
3-
import keepItImage from '../assets/keep-it.png'
3+
import keepItImage from '@/assets/keep-it.png'
44
import Modal from './modal'
55

66
interface ExtensionInstalledModalProps {

src/components/modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AnimatePresence, motion } from 'framer-motion'
22
import { type ReactNode, useEffect } from 'react'
33
import ReactDOM from 'react-dom'
44
import { AiOutlineClose } from 'react-icons/ai'
5-
import { useTheme } from '../context/theme.context'
5+
import { useTheme } from '@/context/theme.context'
66

77
type ModalProps = {
88
isOpen: boolean

src/components/section-panel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from 'framer-motion'
22
import type { ReactNode } from 'react'
3-
import { useTheme } from '../context/theme.context'
3+
import { useTheme } from '@/context/theme.context'
44

55
interface SectionPanelProps {
66
title: string

src/components/selectBox/multiSelectDropdown.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useMemo, useRef, useState } from 'react'
22
import { FiCheck, FiChevronDown, FiSearch, FiX } from 'react-icons/fi'
3-
import { useTheme } from '../../context/theme.context'
3+
import { useTheme } from '@/context/theme.context'
44

55
interface Option {
66
value: string

src/components/text-input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ForwardedRef, forwardRef } from 'react'
2-
import { useTheme } from '../context/theme.context'
2+
import { useTheme } from '@/context/theme.context'
33

44
interface TextInputProps {
55
value: string

src/context/bookmark.context.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { createContext, useEffect, useState } from 'react'
22
import { toast } from 'react-hot-toast'
3-
import { getFromStorage, setToStorage } from '../common/storage'
4-
import type { Bookmark } from '../layouts/search/bookmarks/types/bookmark.types'
3+
import { getFromStorage, setToStorage } from '@/common/storage'
4+
import type { Bookmark } from 'W/layouts/search/bookmarks/types/bookmark.types'
55

66
const MAX_BOOKMARK_SIZE = 1.5 * 1024 * 1024
77

src/context/currency.context.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { createContext, useEffect, useState } from 'react'
2-
import { getFromStorage, setToStorage } from '../common/storage'
2+
import { getFromStorage, setToStorage } from '@/common/storage'
33

44
export interface StoreContext {
55
selectedCurrencies: Array<string>

src/context/general-setting.context.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type React from 'react'
22
import { createContext, useCallback, useContext, useEffect, useState } from 'react'
3-
import { getFromStorage, setToStorage } from '../common/storage'
3+
import { getFromStorage, setToStorage } from '@/common/storage'
44

55
export type FontFamily = 'Vazir' | 'digiLalezarPlus'
66

src/context/theme.context.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type React from 'react'
22
import { createContext, useCallback, useContext, useEffect, useState } from 'react'
3-
import { getFromStorage, setToStorage } from '../common/storage'
3+
import { getFromStorage, setToStorage } from '@/common/storage'
44

55
interface ThemeContextType {
66
theme: string

src/context/todo.context.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type React from 'react'
22
import { createContext, useContext, useEffect, useState } from 'react'
33
import { v4 as uuidv4 } from 'uuid'
4-
import { getFromStorage, setToStorage } from '../common/storage'
5-
import type { Todo } from '../layouts/calendar/interface/todo.interface'
4+
import { getFromStorage, setToStorage } from '@/common/storage'
5+
import type { Todo } from '@/layouts/calendar/interface/todo.interface'
66

77
interface TodoContextType {
88
todos: Todo[]

src/context/weather.context.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { createContext, useEffect, useState } from 'react'
2-
import { getFromStorage, setToStorage } from '../common/storage'
3-
import type { WeatherSettings } from '../services/getMethodHooks/weather/weather.interface'
2+
import { getFromStorage, setToStorage } from '@/common/storage'
3+
import type { WeatherSettings } from '@/services/getMethodHooks/weather/weather.interface'
44

55
export interface SelectedCity {
66
name: string

src/layouts/arzLive/arzLive.layout.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { motion } from 'framer-motion'
22
import { useState } from 'react'
33
import { FiChevronDown, FiChevronUp } from 'react-icons/fi'
4-
import { useCurrencyStore } from '../../context/currency.context'
5-
import { useTheme } from '../../context/theme.context'
6-
import { useGetSupportCurrencies } from '../../services/getMethodHooks/getSupportCurrencies.hook'
4+
import { useCurrencyStore } from '@/context/currency.context'
5+
import { useTheme } from '@/context/theme.context'
6+
import { useGetSupportCurrencies } from '@/services/getMethodHooks/getSupportCurrencies.hook'
77
import { AddCurrencyBox } from './components/addCurrency-box'
88
import { CurrencyBox } from './components/currency-box'
99

src/layouts/arzLive/components/addCurrency-box.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { motion } from 'framer-motion'
22
import { useState } from 'react'
33
import { AiOutlineLoading } from 'react-icons/ai'
44
import { TiPlus } from 'react-icons/ti'
5-
import Modal from '../../../components/modal'
6-
import { MultiSelectDropdown } from '../../../components/selectBox/multiSelectDropdown.component'
7-
import { useCurrencyStore } from '../../../context/currency.context'
8-
import { useTheme } from '../../../context/theme.context'
5+
import Modal from '@/components/modal'
6+
import { MultiSelectDropdown } from '@/components/selectBox/multiSelectDropdown.component'
7+
import { useCurrencyStore } from '@/context/currency.context'
8+
import { useTheme } from '@/context/theme.context'
99

1010
export type SupportedCurrencies = {
1111
key: string

src/layouts/arzLive/components/currency-box.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { motion, useMotionValue, useSpring } from 'framer-motion'
22
import ms from 'ms'
33
import { useEffect, useRef, useState } from 'react'
44
import { FaArrowDownLong, FaArrowUpLong } from 'react-icons/fa6'
5-
import { getMainColorFromImage } from '../../../common/color'
6-
import { getFromStorage, setToStorage } from '../../../common/storage'
7-
import { useTheme } from '../../../context/theme.context'
5+
import { getMainColorFromImage } from '@/common/color'
6+
import { getFromStorage, setToStorage } from '@/common/storage'
7+
import { useTheme } from '@/context/theme.context'
88
import {
99
type FetchedCurrency,
1010
useGetCurrencyByCode,
11-
} from '../../../services/getMethodHooks/getCurrencyByCode.hook'
11+
} from '@/services/getMethodHooks/getCurrencyByCode.hook'
1212
import { CurrencyModalComponent } from './currency-modal'
1313

1414
interface CurrencyBoxProps {

src/layouts/arzLive/components/currency-modal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { AnimatePresence, motion } from 'framer-motion'
22
import { useState } from 'react'
33
import { FaArrowDownLong, FaArrowUpLong, FaChartLine } from 'react-icons/fa6'
4-
import Modal from '../../../components/modal'
5-
import { useTheme } from '../../../context/theme.context'
4+
import Modal from '@/components/modal'
5+
import { useTheme } from '@/context/theme.context'
66
import { CurrencyChart } from './currency-chart'
77

88
interface CurrencyModalComponentProps {

src/layouts/calendar/calendar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { AnimatePresence, motion } from 'framer-motion'
22
import jalaliMoment from 'jalali-moment'
33
import type React from 'react'
44
import { useCallback, useState } from 'react'
5-
import { useTheme } from '../../context/theme.context'
6-
import { TodoProvider } from '../../context/todo.context'
5+
import { useTheme } from '@/context/theme.context'
6+
import { TodoProvider } from '@/context/todo.context'
77
import { CalendarContainer } from './components/calendar-container'
88
import { CalendarContent } from './components/calendar-content'
99
import { CalendarGrid } from './components/calendar-grid'

src/layouts/calendar/components/calendar-container.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type React from 'react'
2-
import { useTheme } from '../../../context/theme.context'
2+
import { useTheme } from '@/context/theme.context'
33

44
interface CalendarContainerProps {
55
children: React.ReactNode

src/layouts/calendar/components/calendar-grid.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type jalaliMoment from 'jalali-moment'
22
import type React from 'react'
33
import { v4 as uuidv4 } from 'uuid'
4-
import { useTheme } from '../../../context/theme.context'
5-
import { useTodoStore } from '../../../context/todo.context'
6-
import { useGetEvents } from '../../../services/getMethodHooks/getEvents.hook'
4+
import { useTheme } from '@/context/theme.context'
5+
import { useTodoStore } from '@/context/todo.context'
6+
import { useGetEvents } from '@/services/getMethodHooks/getEvents.hook'
77
import { formatDateStr } from '../utils'
88
import { DayItem } from './day'
99

src/layouts/calendar/components/calendar-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type React from 'react'
44
import { useMemo } from 'react'
55
import { FaChevronLeft, FaChevronRight } from 'react-icons/fa6'
66
import { FiCalendar } from 'react-icons/fi'
7-
import { useTheme } from '../../../context/theme.context'
7+
import { useTheme } from '@/context/theme.context'
88

99
const PERSIAN_MONTHS = [
1010
'فروردین',

src/layouts/calendar/components/day-slider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { motion } from 'framer-motion'
22
import jalaliMoment from 'jalali-moment'
33
import { FaChevronLeft, FaChevronRight } from 'react-icons/fa6'
4-
import { useTheme } from '../../../context/theme.context'
4+
import { useTheme } from '@/context/theme.context'
55

66
interface DaySliderProps {
77
currentDate: jalaliMoment.Moment

src/layouts/calendar/components/day-summary.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { motion } from 'framer-motion'
22
import type jalaliMoment from 'jalali-moment'
33
import type React from 'react'
44
import { FiCalendar, FiChevronRight, FiClipboard } from 'react-icons/fi'
5-
import { useTheme } from '../../../context/theme.context'
6-
import { useTodoStore } from '../../../context/todo.context'
7-
import { useGetEvents } from '../../../services/getMethodHooks/getEvents.hook'
5+
import { useTheme } from '@/context/theme.context'
6+
import { useTodoStore } from '@/context/todo.context'
7+
import { useGetEvents } from '@/services/getMethodHooks/getEvents.hook'
88
import type { TabType } from '../calendar'
99
import { formatDateStr } from '../utils'
1010
import { getGregorianEvents, getHijriEvents, getShamsiEvents } from '../utils'

src/layouts/calendar/components/day.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import jalaliMoment from 'jalali-moment'
2-
import { useTheme } from '../../../context/theme.context'
3-
import type { FetchedAllEvents } from '../../../services/getMethodHooks/getEvents.hook'
2+
import { useTheme } from '@/context/theme.context'
3+
import type { FetchedAllEvents } from '@/services/getMethodHooks/getEvents.hook'
44
import type { Todo } from '../interface/todo.interface'
55
import { formatDateStr, getHijriEvents, getShamsiEvents } from '../utils'
66

src/layouts/calendar/components/events/event.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { motion } from 'framer-motion'
22
import type jalaliMoment from 'jalali-moment'
33
import { FiCalendar } from 'react-icons/fi'
4-
import { useTheme } from '../../../../context/theme.context'
5-
import type { FetchedAllEvents } from '../../../../services/getMethodHooks/getEvents.hook'
4+
import { useTheme } from '@/context/theme.context'
5+
import type { FetchedAllEvents } from '@/services/getMethodHooks/getEvents.hook'
66
import { getGregorianEvents, getHijriEvents, getShamsiEvents } from '../../utils'
77

88
interface Prop {

src/layouts/calendar/components/pomodoro/components/settings-panel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from 'framer-motion'
22
import type React from 'react'
3-
import Modal from '../../../../../components/modal'
3+
import Modal from '@/components/modal'
44
import type { PomodoroSettings } from '../types'
55

66
interface SettingInputProps {

src/layouts/calendar/components/pomodoro/pomodoro-timer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
FiRefreshCw,
1010
FiSettings,
1111
} from 'react-icons/fi'
12-
import { useTheme } from '../../../../context/theme.context'
12+
import { useTheme } from '@/context/theme.context'
1313
import { ControlButton } from './components/control-button'
1414
import { ModeButton } from './components/mode-button'
1515
import { PomodoroSettingsPanel } from './components/settings-panel'

src/layouts/calendar/components/tab-navigation.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { motion } from 'framer-motion'
22
import type React from 'react'
33
import { FiCalendar, FiClipboard, FiWatch } from 'react-icons/fi'
44
import { IoAnalyticsOutline } from 'react-icons/io5'
5-
import { useTheme } from '../../../context/theme.context'
5+
import { useTheme } from '@/context/theme.context'
66
import type { TabType } from '../calendar'
77

88
interface TabNavigationProps {

src/layouts/calendar/components/todos/todo-input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react'
22
import { FiFlag, FiTag } from 'react-icons/fi'
33
import Analytics from '../../../../analytics'
4-
import { useTheme } from '../../../../context/theme.context'
4+
import { useTheme } from '@/context/theme.context'
55

66
interface Prop {
77
onAdd: (

src/layouts/calendar/components/todos/todo-stats.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useMemo } from 'react'
2-
import { useTheme } from '../../../../context/theme.context'
3-
import { useTodoStore } from '../../../../context/todo.context'
2+
import { useTheme } from '@/context/theme.context'
3+
import { useTodoStore } from '@/context/todo.context'
44

55
export function TodoStats() {
66
const { todos } = useTodoStore()

src/layouts/calendar/components/todos/todo.item.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react'
22
import { FiChevronDown, FiChevronUp, FiEdit, FiTrash2 } from 'react-icons/fi'
3-
import CustomCheckbox from '../../../../components/checkbox'
4-
import { useTheme } from '../../../../context/theme.context'
3+
import CustomCheckbox from '@/components/checkbox'
4+
import { useTheme } from '@/context/theme.context'
55
import type { Todo } from '../../interface/todo.interface'
66

77
interface Prop {

src/layouts/calendar/components/todos/todos.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type jalaliMoment from 'jalali-moment'
22
import { useEffect, useState } from 'react'
33
import { FaEye, FaEyeSlash } from 'react-icons/fa'
4-
import { getFromStorage, setToStorage } from '../../../../common/storage'
5-
import { useTheme } from '../../../../context/theme.context'
6-
import { useTodoStore } from '../../../../context/todo.context'
4+
import { getFromStorage, setToStorage } from '@/common/storage'
5+
import { useTheme } from '@/context/theme.context'
6+
import { useTodoStore } from '@/context/todo.context'
77
import { formatDateStr } from '../../utils'
88
import { TodoInput } from './todo-input'
99
import { TodoItem } from './todo.item'

src/layouts/navbar/navbar.layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react'
22
import { VscSettings } from 'react-icons/vsc'
3-
import { Colors } from '../../common/constant/colors.constant'
3+
import { Colors } from '@/common/constant/colors.constant'
44
import { SettingModal } from '../setting/setting-modal'
55

66
export interface PageLink {

src/layouts/search/bookmarks/bookmarks.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useEffect, useState } from 'react'
2-
import { getFromStorage } from '../../../common/storage'
3-
import { useBookmarkStore } from '../../../context/bookmark.context'
4-
import { useTheme } from '../../../context/theme.context'
2+
import { getFromStorage } from '@/common/storage'
3+
import { useBookmarkStore } from '@/context/bookmark.context'
4+
import { useTheme } from '@/context/theme.context'
55
import {
66
type FetchedSuggestionsBookmark,
77
useGetBookmarks,
8-
} from '../../../services/getMethodHooks/getBookmarks.hook'
8+
} from '@/services/getMethodHooks/getBookmarks.hook'
99
import { AddBookmarkModal } from './components/add-bookmark.modal'
1010
import { BookmarkContextMenu } from './components/bookmark-context-menu'
1111
import { BookmarkItem } from './components/bookmark-item'

src/layouts/search/bookmarks/components/add-bookmark.modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AnimatePresence, motion } from 'framer-motion'
22
import { useRef, useState } from 'react'
33
import { FaImage, FaUpload } from 'react-icons/fa'
44
import { v4 as uuidv4 } from 'uuid'
5-
import Modal from '../../../../components/modal'
5+
import Modal from '@/components/modal'
66
import type { Bookmark, BookmarkType } from '../types/bookmark.types'
77

88
interface AddBookmarkModalProps {

src/layouts/search/search.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { useRef, useState } from 'react'
22
import { CiSearch } from 'react-icons/ci'
33
import { MdOutlineClear } from 'react-icons/md'
44
import Browser from 'webextension-polyfill'
5-
import { BookmarkProvider } from '../../context/bookmark.context'
6-
import { useTheme } from '../../context/theme.context'
5+
import { BookmarkProvider } from '@/context/bookmark.context'
6+
import { useTheme } from '@/context/theme.context'
77
import { BookmarksComponent } from './bookmarks/bookmarks'
88

99
export function SearchLayout() {

src/layouts/setting/setting-modal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import clsx from 'clsx'
22
import { AnimatePresence, motion } from 'framer-motion'
33
import { useState } from 'react'
44
import { VscCloud, VscInfo, VscPaintcan, VscSettingsGear } from 'react-icons/vsc'
5-
import Modal from '../../components/modal'
6-
import { useTheme } from '../../context/theme.context'
5+
import Modal from '@/components/modal'
6+
import { useTheme } from '@/context/theme.context'
77
import { AboutUsTab } from './tabs/about-us/about-us'
88
import { GeneralSettingTab } from './tabs/general/general'
99
import { WallpaperSetting } from './tabs/wallpapers/wallpapers'

0 commit comments

Comments
 (0)