-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUserTypeSwitch.tsx
54 lines (49 loc) · 1.95 KB
/
UserTypeSwitch.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// import * as React from "react"
// import { useState } from "react"
// import { motion } from "framer-motion"
// import { useContext } from "react"
// import { UserContext } from "@/contexts/UserContext"
// export const UserTypeSwitch: React.FC = React.memo(() => {
// const { userType, setUserType } = useContext(UserContext)
// const [isProductOwner, setIsProductOwner] = useState(userType === 'business')
// const toggleSwitch = () => {
// setIsProductOwner(!isProductOwner)
// setUserType(!isProductOwner ? 'business' : 'developer')
// window.scrollTo({
// top: window.innerHeight,
// behavior: 'smooth'
// });
// }
// return (
// <motion.div
// className="w-72 h-12 bg-gradient-to-r from-purple-500 to-violet-400 rounded-full p-1 cursor-pointer shadow-lg"
// onClick={toggleSwitch}
// animate={{
// background: isProductOwner
// ? "linear-gradient(to right, #E2E8F0, #F8FAFC)"
// : "linear-gradient(to right, #8B5CF6, #A78BFA)",
// }}
// >
// <motion.div
// className="w-full h-full bg-[#0A0A1F] rounded-full shadow-md relative flex items-center"
// animate={{
// x: isProductOwner ? "calc(100% - 100%)" : "0%",
// }}
// transition={{ type: "spring", stiffness: 700, damping: 30 }}
// >
// <div className="absolute inset-0 flex items-center justify-between px-6 gap-2">
// <span
// className={`text-sm font-medium transition-colors select-none whitespace-nowrap ${!isProductOwner ? "text-purple-600" : "text-gray-600"}`}
// >
// I'm a developer
// </span>
// <span
// className={`text-sm font-medium transition-colors select-none whitespace-nowrap ${isProductOwner ? "text-white" : "text-gray-500"}`}
// >
// I'm a product owner
// </span>
// </div>
// </motion.div>
// </motion.div>
// )
// })