Skip to content

Instantly share code, notes, and snippets.

View rahulmore01's full-sized avatar
💭
learning typescript

Rahul Ashok More rahulmore01

💭
learning typescript
View GitHub Profile
@rahulmore01
rahulmore01 / Navbar.jsx
Created July 11, 2024 09:19
navbar with next auth
import { useSession, signIn, signOut } from "next-auth/react"
export default function Navbar() {
const { data: session } = useSession()
if (session) {
return (
<>
Signed in as {session.user.email} <br />
<button onClick={() => signOut()}>Sign out</button>
</>
@rahulmore01
rahulmore01 / layout.js
Created July 11, 2024 08:48
root layout next js, for next auth
import "../styles/globals.css";
import AuthProvider from "@/utility/nextauth-session-provider";
export default async function RootLayout({ children }) {
return (
<>
<html lang="en" suppressHydrationWarning>
<head />
<body>
<AuthProvider>{children}</AuthProvider>
@rahulmore01
rahulmore01 / nextauth-session-provider.js
Created July 11, 2024 08:40
next auth provider file
"use client";
import { SessionProvider } from "next-auth/react";
const AuthProvider = ({ children }) => {
return <SessionProvider>{children}</SessionProvider>;
};
export default AuthProvider;
@rahulmore01
rahulmore01 / route.js
Last active July 11, 2024 08:39
next auth route file to setup next auth
import NextAuth from "next-auth/next";
import GoogleProvider from "next-auth/providers/google";
const handler = NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
],
@rahulmore01
rahulmore01 / GenerateUi.jsx
Created December 30, 2023 11:31
genui project
import UiToggle from "@/components/UiToggle";
import React, { useState } from "react";
interface GenerateUiProps {
onToggleCode: (newToggleCodeValue: boolean) => void;
}
const GenerateUi: React.FC<GenerateUiProps> = ({ onToggleCode }) => {
const [isToggleCode, setIsToggleCode] = useState(true);
@rahulmore01
rahulmore01 / toggle.jsx
Last active December 30, 2023 11:28
genui project
"use client";
import { Button } from "@/components/ui/button";
import { Code2, PanelsTopLeft } from "lucide-react";
import { useState } from "react";
interface UiToggleProps {
onToggleCode: (newToggleCodeValue: boolean) => void;
}
@rahulmore01
rahulmore01 / layout.js
Last active December 25, 2023 13:23
favicon
export const metadata = {
title: "Rahul More",
description: "A Frontend Developer Portfolio",
};
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
{/* line 11 is the only addition to make in layout.js */}
@rahulmore01
rahulmore01 / layout.js
Created December 7, 2023 01:50
favicon in nextjs
export const metadata = {
title: "Rahul More",
description: "A Frontend Developer Portfolio",
//line 5 to 8 is only addition to make in layout.js
icons: {
icon: "/images/rahul.png",
},
};
export default function RootLayout({ children }) {
@rahulmore01
rahulmore01 / icon.jsx
Created November 26, 2023 05:14
react-icons
import { Bs0Circle } from "react-icons/bs";
function Question() {
 return (
 <h3>
 This is a react icon : <Bs0Circle/>
 </h3>
 );
}
"use client";
import React from "react";
import ReactPlayer from "react-player";
const VideoPlayer = () => {
//video path
let videosrc = "/videos/next.mp4";
return (
<div>