Skip to content

Commit

Permalink
chore: setup husky for git hooks management (#30)
Browse files Browse the repository at this point in the history
* remove onLogin props by using <Link> tag on landing page and rename feature by logic

* refactor(front): update every components

* chore: setup husky for git hooks management
  • Loading branch information
dorian-grst authored Oct 29, 2024
1 parent 42731ff commit 0d64aaf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint
pnpm build
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"prepare": "husky"
},
"dependencies": {
"@radix-ui/react-accordion": "^1.2.1",
Expand Down Expand Up @@ -45,6 +46,7 @@
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.1",
"eslint-config-next": "14.2.5",
"husky": "^9.1.6",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.13",
"typescript": "^5.6.2"
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

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

48 changes: 22 additions & 26 deletions src/app/(gistLayout)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
"use client";

import { ReactNode, useCallback } from "react";
import GistLayout from "./layout-ui";
import { useMe } from "@/lib/queries/user.queries";
import { useToast } from "@/components/shadcn/use-toast";
import { useCreateGist } from "@/lib/queries/gists.queries";
import { useCreateOrg } from "@/lib/queries/orgs.queries";

export default function GistLayoutFeature({
children,
}: {
children: ReactNode;
}) {
const { data, error } = useMe();
const { toast } = useToast();
'use client'

import { ReactNode, useCallback } from 'react'
import GistLayout from './layout-ui'
import { useMe } from '@/lib/queries/user.queries'
import { useToast } from '@/components/shadcn/use-toast'
import { useCreateGist } from '@/lib/queries/gists.queries'
import { useCreateOrg } from '@/lib/queries/orgs.queries'

export default function GistLayoutFeature({ children }: { children: ReactNode }) {
const { data, error } = useMe()
const { toast } = useToast()
const { mutate: createGist } = useCreateGist({
onSuccess: () => {
toast({
title: "Gist Created",
description: "Your gist has been created successfully",
});
title: 'Gist Created',
description: 'Your gist has been created successfully',
})
},
});
})

const { mutate: createOrg } = useCreateOrg({
onSuccess: () => {
Expand All @@ -30,25 +26,25 @@ export default function GistLayoutFeature({
description: "Your org has been created successfully",
});
},
});
})

const onMyGists = () => {};

const onCreateOrg = useCallback(
(name: string) => {
createOrg(name);
createOrg(name)
},
[createOrg],
);

const onLogout = () => {};
const onLogout = () => {}

const onCreateGist = (name: string, content: string) => {
createGist({
content,
name,
});
};
})
}

return (
<GistLayout
Expand All @@ -61,5 +57,5 @@ export default function GistLayoutFeature({
>
{children}
</GistLayout>
);
)
}

0 comments on commit 0d64aaf

Please sign in to comment.