Skip to content

Commit

Permalink
[lint]: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthaMishra-dev committed Feb 26, 2024
1 parent 01888c1 commit 8d64004
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface Props {
session?: Session;
}

export default async function Provider({ children }: Props) {
export default function Provider({ children }: Props) {
return (
<NextUIProvider>
<Toaster
Expand Down
20 changes: 16 additions & 4 deletions app/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@ const Page = () => {
const { data: session } = useSession();
const router = useRouter();

const handleSignIn = async (provider: string) => {
try {
await signIn(provider);
// Redirect to home page after sign-in
router.push("/");
toast.success("Logged in successfully");
} catch (error) {
toast.error("Sign in failed");
console.error("Sign in error:", error);
}
};

useEffect(() => {
if (session) {
toast.success("Logged in successfully");
router.push(`/`);
toast.success("Logged in successfully");
}
}, [session]);
}, [session, router]);
return (
<>
<div className="h-full w-full p-6 ">
Expand All @@ -33,7 +45,7 @@ const Page = () => {
<Button
color="primary"
size="lg"
onClick={() => signIn("github")}
onClick={() => handleSignIn("github")}
>
<FaGithub className="text-lg" />
<span className="font-bold">Continue with Github</span>
Expand All @@ -42,7 +54,7 @@ const Page = () => {
color="primary"
className="mt-4"
size="lg"
onClick={() => signIn("google")}
onClick={() => handleSignIn("google")}
>
<FaGoogle className="text-lg" />
<span className="font-bold">Continue with Google</span>
Expand Down
14 changes: 9 additions & 5 deletions components/BlogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import CommentButton from "./CommentButton";
import LikeButton from "./LikeButton";
import { useEffect, useState } from "react";
import { GetUserImage } from "@/actions/actions";
import Image from "next/image";

interface CardProps {
blog: blogs;
Expand All @@ -28,11 +29,14 @@ const BlogCard = ({ blog, handleLike, handleComment }: CardProps) => {
<>
<Card className="w-full p-2 m-4 bg-theme text-cyan-50 font-semibold drop-shadow-2xl bg-transparent">
<div className="flex space-x-2">
<img
className="h-10 w-10 rounded-full"
src={image}
alt="profile"
/>
<div className="relative h-10 w-10">
<Image
fill
className="rounded-full object-center object-cover"
src={image}
alt="profile"
/>
</div>
<div>
<CardHeader className=" px-3 pt-0">
<div className="flex flex-col">
Expand Down
10 changes: 8 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ const nextConfig = {
remotePatterns: [
{
protocol: "https",
hostname: "media4.giphy.com",
hostname: "avatars.githubusercontent.com",
port: "",
pathname: "/media/**",
pathname: "**",
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
port: "",
pathname: "**",
},
],
},
Expand Down

0 comments on commit 8d64004

Please sign in to comment.