11import React from "react" ;
22import Link from "next/link" ;
33import { CopyToClipboard } from "react-copy-to-clipboard" ;
4- import { DocumentDuplicateIcon } from "@heroicons/react/24/outline" ;
4+ import { CheckIcon , DocumentDuplicateIcon } from "@heroicons/react/24/outline" ;
55import {
66 Chip ,
77 Typography ,
88 Button ,
99 Card ,
1010 IconButton ,
11- Menu ,
12- MenuHandler ,
13- MenuItem ,
14- MenuList ,
1511} from "@material-tailwind/react" ;
1612
1713interface StatsCardPropsType {
@@ -55,7 +51,7 @@ const stats = [
5551
5652export function Hero ( ) {
5753 const [ copied , setCopied ] = React . useState ( false ) ;
58- const [ active , setActive ] = React . useState ( 2 ) ;
54+ const [ isHtml , setIsHtml ] = React . useState ( false ) ;
5955
6056 return (
6157 < >
@@ -83,53 +79,54 @@ export function Hero() {
8379 bonus!
8480 </ Typography >
8581 < div className = "flex shrink-0 flex-wrap place-content-center items-center gap-4" >
86- < div className = "inline-flex items-center justify-between gap-3 rounded-lg border-[1.5px] border-blue-gray-50 bg-white py-1 px-2 font-medium text-primary" >
87- < Typography variant = "h6" >
88- npm i @material-tailwind/react
82+ < div className = "inline-flex items-center justify-between gap-0.5 rounded-lg border-[1.5px] border-blue-gray-50 bg-white p-1 font-medium text-primary" >
83+ < Typography variant = "h6" className = "mx-4" >
84+ npm i @material-tailwind/{ isHtml ? "html" : " react" }
8985 </ Typography >
9086 < div >
9187 < CopyToClipboard
9288 onCopy = { ( ) => setCopied ( true ) }
93- text = " npm i @material-tailwind/react"
89+ text = { ` npm i @material-tailwind/${ isHtml ? "html" : " react"} ` }
9490 >
9591 < IconButton
9692 color = "white"
97- className = { `cursor-pointer ${
98- active === 1 ? "opacity-100" : "opacity-50"
99- } `}
93+ variant = "text"
10094 onMouseLeave = { ( ) => setCopied ( false ) }
101- onClick = { ( ) => setActive ( 1 ) }
10295 >
103- < DocumentDuplicateIcon className = "h-5 w-5 text-gray-700" />
96+ { copied ? (
97+ < CheckIcon className = "h-5 w-5 text-green-600" />
98+ ) : (
99+ < DocumentDuplicateIcon className = "h-5 w-5 text-gray-700" />
100+ ) }
104101 </ IconButton >
105102 </ CopyToClipboard >
106103 </ div >
107104 < IconButton
108105 className = { `cursor-pointer ${
109- active === 2 ? "opacity-100" : "opacity-50 grayscale"
106+ ! isHtml ? "opacity-100" : "opacity-50 grayscale"
110107 } `}
111- size = "sm"
112108 color = "white"
113- onClick = { ( ) => setActive ( 2 ) }
109+ variant = "text"
110+ onClick = { ( ) => setIsHtml ( false ) }
114111 >
115112 < img
116113 src = "/img/logos/icon-react.svg"
117114 alt = "react-icon"
118- className = "h-5 w-5 "
115+ className = "h-6 w-6 "
119116 />
120117 </ IconButton >
121118 < IconButton
122119 className = { `cursor-pointer ${
123- active === 3 ? "opacity-100" : "opacity-50 grayscale"
120+ isHtml ? "opacity-100" : "opacity-50 grayscale"
124121 } `}
125- size = "sm "
122+ variant = "text "
126123 color = "white"
127- onClick = { ( ) => setActive ( 3 ) }
124+ onClick = { ( ) => setIsHtml ( true ) }
128125 >
129126 < img
130127 src = "/img/logos/icon-html.svg"
131128 alt = "html-icon"
132- className = "h-5 w-5 "
129+ className = "h-6 w-6 "
133130 />
134131 </ IconButton >
135132 </ div >
@@ -151,57 +148,6 @@ export function Hero() {
151148 </ div >
152149 </ div >
153150 </ div >
154- < Card className = "fixed right-10 top-20 translate-y-[42rem] border border-gray-100 p-3" >
155- < Menu placement = "bottom-end" >
156- < MenuHandler >
157- < IconButton size = "lg" color = "white" >
158- < img
159- src = "/img/logos/icon-react.svg"
160- alt = "react-icon"
161- className = "h-20 w-20"
162- />
163- </ IconButton >
164- </ MenuHandler >
165- < MenuList className = "mt-4" >
166- < Link href = "/docs/react/installation" target = "_blank" >
167- < MenuItem className = "flex items-center gap-2" >
168- < img
169- src = "/img/logos/icon-react.svg"
170- alt = "react-icon"
171- className = "h-6 w-6"
172- />
173- < Typography variant = "h6" color = "blue-gray" >
174- React
175- </ Typography >
176- </ MenuItem >
177- </ Link >
178- < Link href = "/docs/html/installation" target = "_blank" >
179- < MenuItem className = "flex items-center gap-2" >
180- < img
181- src = "/img/logos/icon-html.svg"
182- alt = "html-icon"
183- className = "h-6 w-6"
184- />
185- < Typography variant = "h6" color = "blue-gray" >
186- HTML
187- </ Typography >
188- </ MenuItem >
189- </ Link >
190- < Link href = "/figma" target = "_blank" >
191- < MenuItem className = "flex items-center gap-2" >
192- < img
193- src = "/img/icon-figma.svg"
194- alt = "figma-icon"
195- className = "h-6 w-6"
196- />
197- < Typography variant = "h6" color = "blue-gray" >
198- Figma
199- </ Typography >
200- </ MenuItem >
201- </ Link >
202- </ MenuList >
203- </ Menu >
204- </ Card >
205151 </ >
206152 ) ;
207153}
0 commit comments