Skip to content

Instantly share code, notes, and snippets.

@Sathiyapramod
Created February 25, 2024 07:23
Show Gist options
  • Save Sathiyapramod/092b34230d8b28d6e6d91329bdd9f80e to your computer and use it in GitHub Desktop.
Save Sathiyapramod/092b34230d8b28d6e6d91329bdd9f80e to your computer and use it in GitHub Desktop.
Profile Page
import { ReduxProvider } from "@/redux/provider";
import Login from "./components/Login";
export default function RootLayout() {
return (
<html lang="en">
<body>
<ReduxProvider>
<Login />
</ReduxProvider>
</body>
</html>
);
}
//Profile/page.js
"use client";
import React from "react";
import { useSelector } from "react-redux";
export default function Page() {
const username = useSelector((state) => state.rootReducer.username);
const password = useSelector((state) => state.rootReducer.password);
return (
<div className="profile-container">
<div>
<h3>Profile Details</h3>
<br />
<div>Profile Name &nbsp;{username}</div>
<div>Password:&nbsp;{password}</div>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment