File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,8 @@ interface ButtonProps {
104104const SomeButton = cm .button <ButtonProps >`
105105 text-lg
106106 mt-5
107- ${(
108- p ,
109- ) => (p .$isActive ? " bg-blue-400 text-white" : " bg-blue-400 text-blue-200" )}
110- ${(p ) => (p .$isLoading ? " opacity-90 pointer-events-none" : " " )}
107+ ${({ $isActive }) => ($isActive ? " bg-blue-400 text-white" : " bg-blue-400 text-blue-200" )}
108+ ${({ $isLoading }) => ($isLoading ? " opacity-90 pointer-events-none" : " " )}
111109` ;
112110// transforms to <button className="text-lg mt-5 bg-blue-400 text-white opacity-90 pointer-events-none" />
113111```
Original file line number Diff line number Diff line change @@ -104,10 +104,8 @@ interface ButtonProps {
104104const SomeButton = cm .button <ButtonProps >`
105105 text-lg
106106 mt-5
107- ${(
108- p ,
109- ) => (p .$isActive ? " bg-blue-400 text-white" : " bg-blue-400 text-blue-200" )}
110- ${(p ) => (p .$isLoading ? " opacity-90 pointer-events-none" : " " )}
107+ ${({ $isActive }) => ($isActive ? " bg-blue-400 text-white" : " bg-blue-400 text-blue-200" )}
108+ ${({ $isLoading }) => ($isLoading ? " opacity-90 pointer-events-none" : " " )}
111109` ;
112110// transforms to <button className="text-lg mt-5 bg-blue-400 text-white opacity-90 pointer-events-none" />
113111```
@@ -135,17 +133,16 @@ const Alert = cm.div.variants<AlertProps>({
135133 // optional
136134 base : (p ) => `
137135 ${p .isActive ? " custom-active" : " custom-inactive" }
138- p-4
139- rounded-md
136+ p-4 rounded-md
140137 ` ,
141138 // required
142139 variants: {
143140 $severity: {
144141 warning: " bg-yellow-100 text-yellow-800" ,
145- info : (p ) =>
146- ` bg-blue-100 text-blue-800 ${p . $isActive ? " shadow-lg" : " " } ` ,
147- error : (p ) =>
148- ` bg-red-100 text-red-800 ${p . $isActive ? " ring ring-red-500" : " " } ` ,
142+ info : ({ $isActive } ) =>
143+ ` bg-blue-100 text-blue-800 ${ $isActive ? " shadow-lg" : " " } ` ,
144+ error : ({ $isActive } ) =>
145+ ` bg-red-100 text-red-800 ${ $isActive ? " ring ring-red-500" : " " } ` ,
149146 },
150147 },
151148 // optional - used if no variant was found
You can’t perform that action at this time.
0 commit comments