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

Rename utils folder to core #94

Merged
merged 1 commit into from
Jan 28, 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
4 changes: 2 additions & 2 deletions components/Categories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChangeEvent } from 'react'
import { AnimatePresence } from 'framer-motion'

import { CategoryName } from '../utils/types/Category'
import { PersonList } from '../utils/types/Person'
import { CategoryName } from '../core/types/Category'
import { PersonList } from '../core/types/Person'

import { Mode, useModeContext } from '../context/ModeContext'
import { usePeopleDispatchContext } from '../context/PeopleContext'
Expand Down
2 changes: 1 addition & 1 deletion components/RelativeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link'
import { ChangeEvent } from 'react'
import { usePeopleDispatchContext } from '../context/PeopleContext'
import { Person } from '../utils/types/Person'
import { Person } from '../core/types/Person'

interface RelativeCardProps {
id: string
Expand Down
4 changes: 2 additions & 2 deletions components/RelativeCardList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AnimatePresence, motion } from 'framer-motion'

import { CategoryName } from '../utils/types/Category'
import { CategoryName } from '../core/types/Category'
import { usePeopleDispatchContext } from '../context/PeopleContext'
import { Mode } from '../context/ModeContext'

import RelativeCard from './RelativeCard'
import { PersonList } from '../utils/types/Person'
import { PersonList } from '../core/types/Person'

interface RelativeCardListProps {
id: string
Expand Down
2 changes: 1 addition & 1 deletion components/RelativesForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeEvent, FormEvent } from 'react'
import { Person, PersonList } from '../utils/types/Person'
import { Person, PersonList } from '../core/types/Person'

import { usePeopleDispatchContext } from '../context/PeopleContext'

Expand Down
4 changes: 2 additions & 2 deletions components/Results.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Dispatch, SetStateAction, useState } from 'react'
import Fraction from 'fraction.js'
import { Person, PersonList } from '../utils/types/Person'
import { CategoryName } from '../utils/types/Category'
import { Person, PersonList } from '../core/types/Person'
import { CategoryName } from '../core/types/Category'

import { useModeContext } from '../context/ModeContext'
import { useMoneyContext } from '../context/MoneyContext'
Expand Down
4 changes: 2 additions & 2 deletions context/PeopleContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, Dispatch, ReactNode, useContext, useReducer } from 'react'
import { CategoryName } from '../utils/types/Category'
import { Person, PersonList } from '../utils/types/Person'
import { CategoryName } from '../core/types/Category'
import { Person, PersonList } from '../core/types/Person'

export const PeopleContext = createContext<PersonList | null>(null)
export const PeopleDispatchContext = createContext<Dispatch<PeopleAction> | null>(null)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion hooks/useMe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import { usePeopleContext } from '../context/PeopleContext'
import { Person, PersonList } from '../utils/types/Person'
import { Person, PersonList } from '../core/types/Person'

export function useMe(id: string): { me: Person | undefined; list: PersonList } {
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion pages/api/inheritance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { calculateInheritance } from '../../utils/inheritance'
import { calculateInheritance } from '../../core/inheritance'

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== 'POST') return res.status(405).send({ error: 'Method not allowed' })
Expand Down
2 changes: 1 addition & 1 deletion pages/api/patrimony.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { calculatePatrimony } from '../../utils/patrimony'
import { calculatePatrimony } from '../../core/patrimony'

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== 'POST') return res.status(405).send({ error: 'Method not allowed' })
Expand Down
Loading