Skip to content

Commit

Permalink
feat: who are you for profile stored in redux
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank-dev07 committed Nov 6, 2024
1 parent 7025239 commit 1d15d49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/app/(pages)/listunescrowed/component/Tab1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ import {
import { ArrowBigRight } from "lucide-react";
import NextButton from "@/components/Button/NextButton";
import Image from "next/image";
import { useDispatch, useSelector } from "react-redux";

type Props = {
onNext: () => void;
};

const Tab1 = ({ onNext }: Props) => {
const [selectedCard, setSelectedCard] = useState<string>("");
const dispatch = useDispatch();
const who = useSelector((state: any) => state.profile.who);

const handleSelect = (value: string) => {
setSelectedCard(value);
dispatch({ type: "profile/setWho", payload: value });
};

return (
Expand All @@ -38,7 +40,7 @@ const Tab1 = ({ onNext }: Props) => {
className={`lg:mx-10 p-5 py-8 flex flex-col gap-5 justify-center items-center
hover:shadow-lg hover:shadow-[#34597e]
${
selectedCard != "Organization"
who != "Organization"
? "shadow-[#34597e] shadow-lg"
: "opacity-50 "
}`}
Expand All @@ -56,7 +58,7 @@ const Tab1 = ({ onNext }: Props) => {
className={`lg:mx-10 p-5 py-8 flex flex-col gap-5 justify-center items-center
hover:shadow-lg hover:shadow-[#34597e]
${
selectedCard !== "Individual"
who !== "Individual"
? "shadow-[#34597e] shadow-lg"
: "opacity-50 "
}`}
Expand Down
4 changes: 2 additions & 2 deletions src/app/(pages)/listunescrowed/component/Tab2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import {
ArrowBigLeft,
ArrowBigRight,
Expand All @@ -19,6 +19,7 @@ import {
User2Icon,
} from "lucide-react";
import NextButton from "@/components/Button/NextButton";
import { useSelector } from "react-redux";

type Props = {
onPrev: () => void;
Expand All @@ -28,7 +29,6 @@ type Props = {
const Tab2 = ({ onPrev, onNext }: Props) => {
const [avatar, setAvatar] = useState<string | null>("");
const [isDragging, setIsDragging] = useState(false);

const handleAvatarChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const file = event.target.files?.[0];
if (file) {
Expand Down
1 change: 0 additions & 1 deletion src/app/Redux/Features/profile/profileSlice.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { set } from "react-hook-form";

type Profilestate = {
who: string;
Expand Down

0 comments on commit 1d15d49

Please sign in to comment.