Skip to content

Commit

Permalink
Release v1.1.0 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusThielker authored Mar 17, 2024
2 parents 6ea3d90 + 86b47db commit b34f5e7
Show file tree
Hide file tree
Showing 23 changed files with 557 additions and 305 deletions.
17 changes: 15 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "next-finances",
"description": "A finances application to keep track of my personal spendings",
"homepage": "https://github.com/MarkusThielker/next-finances",
"version": "1.0.1",
"version": "1.1.0",
"license": "MIT",
"author": {
"name": "Markus Thielker"
Expand Down Expand Up @@ -50,6 +50,7 @@
"swr": "^2.2.5",
"tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7",
"vaul": "^0.9.0",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function AccountPage() {

return (
<div className="flex flex-col items-center">
<Card className="w-full max-w-md mt-12">
<Card className="w-full max-w-md md:mt-12">
<CardHeader>
<CardTitle>Hey, {user?.username}!</CardTitle>
<CardDescription>This is your account overview.</CardDescription>
Expand Down Expand Up @@ -81,7 +81,7 @@ export default async function AccountPage() {
</div>
</div>
</CardContent>
<CardFooter className="space-x-4">
<CardFooter className="grid gap-4 grid-cols-1 md:grid-cols-2">
{
process.env.NODE_ENV === 'development' && (
<GenerateSampleDataForm onSubmit={generateSampleData}/>
Expand Down
1 change: 1 addition & 0 deletions src/app/categories/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const columns = (
</svg>
);
},
size: 65,
},
{
accessorKey: 'createdAt',
Expand Down
2 changes: 1 addition & 1 deletion src/app/categories/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export default async function CategoriesPage() {
categories={categories}
onSubmit={categoryCreateUpdate}
onDelete={categoryDelete}
className="flex flex-col justify-center space-y-4 p-10"/>
className="flex flex-col justify-center space-y-4"/>
);
}
1 change: 1 addition & 0 deletions src/app/entities/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const columns = (
{
accessorKey: 'type',
header: 'Type',
size: 100,
},
{
accessorKey: 'createdAt',
Expand Down
2 changes: 1 addition & 1 deletion src/app/entities/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export default async function EntitiesPage() {
entities={entities}
onSubmit={entityCreateUpdate}
onDelete={entityDelete}
className="flex flex-col justify-center space-y-4 p-10"/>
className="flex flex-col justify-center space-y-4"/>
);
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default function RootLayout({
<html lang="en">
<body className={cn('dark', inter.className)}>
<Navigation/>
<main>
<main className="p-4 sm:p-8">
{children}
<Toaster/>
</main>
<Toaster/>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default async function DashboardPage(props: { searchParams?: { scope: Sco
categoryPercentages={categoryPercentages}
entityExpenses={entityExpensesFormat}
entityPercentages={entityPercentages}
className="flex flex-col justify-center space-y-4 p-10"
className="flex flex-col justify-center space-y-4"
/>
);
}
6 changes: 6 additions & 0 deletions src/app/payments/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const columns = (
cell: ({row}) => {
return format(row.original.date, 'PPP');
},
size: 175,
},
{
accessorKey: 'amount',
Expand All @@ -28,6 +29,7 @@ export const columns = (
currency: 'EUR',
}).format(row.getValue('amount') as number / 100);
},
size: 70,
},
{
accessorKey: 'payorId',
Expand All @@ -36,6 +38,7 @@ export const columns = (
const entity = entities.find((entity) => entity.id === row.original.payorId);
return entity?.name ?? '-';
},
size: 200,
},
{
accessorKey: 'payeeId',
Expand All @@ -44,6 +47,7 @@ export const columns = (
const entity = entities.find((entity) => entity.id === row.original.payeeId);
return entity?.name ?? '-';
},
size: 200,
},
{
accessorKey: 'categoryId',
Expand All @@ -60,10 +64,12 @@ export const columns = (
</div>
);
},
size: 200,
},
{
accessorKey: 'note',
header: 'Note',
size: 200,
},
{
id: 'actions',
Expand Down
2 changes: 1 addition & 1 deletion src/app/payments/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ export default async function PaymentsPage() {
categories={categories}
onSubmit={paymentCreateUpdate}
onDelete={paymentDelete}
className="flex flex-col justify-center space-y-4 p-10"/>
className="flex flex-col justify-center space-y-4"/>
);
}
68 changes: 48 additions & 20 deletions src/components/categoryPageClientComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
} from '@/components/ui/alert-dialog';
import { categoryFormSchema } from '@/lib/form-schemas/categoryFormSchema';
import CategoryForm from '@/components/form/categoryForm';
import { useMediaQuery } from '@/lib/hooks/useMediaQuery';
import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@/components/ui/drawer';

export default function CategoryPageClientContent({categories, onSubmit, onDelete, className}: {
categories: Category[],
Expand All @@ -31,6 +33,7 @@ export default function CategoryPageClientContent({categories, onSubmit, onDelet
className: string,
}) {

const isDesktop = useMediaQuery('(min-width: 768px)');
const router = useRouter();

const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
Expand Down Expand Up @@ -97,26 +100,51 @@ export default function CategoryPageClientContent({categories, onSubmit, onDelet
<p className="text-3xl font-semibold">Categories</p>

{/* Edit dialog */}
<Dialog open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DialogTrigger asChild>
<Button
onClick={() => {
setSelectedCategory(undefined);
setIsEditDialogOpen(true);
}}>
Create Category
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{selectedCategory?.id ? 'Update Category' : 'Create Category'}</DialogTitle>
</DialogHeader>
<CategoryForm
value={selectedCategory}
onSubmit={handleSubmit}
className="flex flex-row space-x-4 py-4"/>
</DialogContent>
</Dialog>
{
isDesktop ? (
<Dialog open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DialogTrigger asChild>
<Button
onClick={() => {
setSelectedCategory(undefined);
setIsEditDialogOpen(true);
}}>
Create Category
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{selectedCategory?.id ? 'Update Category' : 'Create Category'}</DialogTitle>
</DialogHeader>
<CategoryForm
value={selectedCategory}
onSubmit={handleSubmit}
className="flex flex-row space-x-4 py-4"/>
</DialogContent>
</Dialog>
) : (
<Drawer open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DrawerTrigger asChild>
<Button
onClick={() => {
setSelectedCategory(undefined);
setIsEditDialogOpen(true);
}}>
Create Category
</Button>
</DrawerTrigger>
<DrawerContent className="p-4">
<DrawerHeader>
<DrawerTitle>{selectedCategory?.id ? 'Update Category' : 'Create Category'}</DrawerTitle>
</DrawerHeader>
<CategoryForm
value={selectedCategory}
onSubmit={handleSubmit}
className="flex flex-row space-x-4 py-4"/>
</DrawerContent>
</Drawer>
)
}
</div>

{/* Data Table */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboardPageClientComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function DashboardPageClientContent(
return (
<div className={className}>
<div className="flex flex-col space-y-4">
<div className="flex items-center justify-between w-full">
<div className="flex items-center justify-between w-full space-x-8">

<p className="text-3xl font-semibold">Dashboard</p>

Expand Down
68 changes: 48 additions & 20 deletions src/components/entityPageClientComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {
AlertDialogFooter,
AlertDialogHeader,
} from '@/components/ui/alert-dialog';
import { useMediaQuery } from '@/lib/hooks/useMediaQuery';
import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@/components/ui/drawer';

export default function EntityPageClientContent({entities, onSubmit, onDelete, className}: {
entities: Entity[],
Expand All @@ -32,6 +34,7 @@ export default function EntityPageClientContent({entities, onSubmit, onDelete, c
className: string,
}) {

const isDesktop = useMediaQuery('(min-width: 768px)');
const router = useRouter();

const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
Expand Down Expand Up @@ -125,26 +128,51 @@ export default function EntityPageClientContent({entities, onSubmit, onDelete, c
<p className="text-3xl font-semibold">Entities</p>

{/* Edit dialog */}
<Dialog open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DialogTrigger asChild>
<Button
onClick={() => {
setSelectedEntity(undefined);
setIsEditDialogOpen(true);
}}>
Create Entity
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{selectedEntity?.id ? 'Update Entity' : 'Create Entity'}</DialogTitle>
</DialogHeader>
<EntityForm
value={selectedEntity}
onSubmit={handleSubmit}
className="grid grid-cols-1 md:grid-cols-2 gap-4 py-4"/>
</DialogContent>
</Dialog>
{
isDesktop ? (
<Dialog open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DialogTrigger asChild>
<Button
onClick={() => {
setSelectedEntity(undefined);
setIsEditDialogOpen(true);
}}>
Create Entity
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{selectedEntity?.id ? 'Update Entity' : 'Create Entity'}</DialogTitle>
</DialogHeader>
<EntityForm
value={selectedEntity}
onSubmit={handleSubmit}
className="grid grid-cols-1 md:grid-cols-2 gap-4 py-4"/>
</DialogContent>
</Dialog>
) : (
<Drawer open={isEditDialogOpen} onOpenChange={setIsEditDialogOpen}>
<DrawerTrigger asChild>
<Button
onClick={() => {
setSelectedEntity(undefined);
setIsEditDialogOpen(true);
}}>
Create Entity
</Button>
</DrawerTrigger>
<DrawerContent className="p-4">
<DrawerHeader>
<DrawerTitle>{selectedEntity?.id ? 'Update Entity' : 'Create Entity'}</DrawerTitle>
</DrawerHeader>
<EntityForm
value={selectedEntity}
onSubmit={handleSubmit}
className="grid grid-cols-1 md:grid-cols-2 gap-4 py-4"/>
</DrawerContent>
</Drawer>
)
}
</div>

{/* Filter input */}
Expand Down
Loading

0 comments on commit b34f5e7

Please sign in to comment.