@@ -22,22 +22,20 @@ import { reviver } from "@/utils/codeComponentUtils";
2222import { useReward } from "react-rewards" ;
2323import { Button } from "@/components/ui/button" ;
2424import { Game } from "@/types/game" ;
25- import { useProgressStore } from ' @/stores/progress-store' ;
25+ import { useProgressStore } from " @/stores/progress-store" ;
2626
2727export function CodeComponent ( props : { game : Game } ) {
2828 const [ foundError , setFoundError ] = useState ( false ) ;
2929 const [ score , setScore ] = useState ( 0 ) ;
3030 const [ tried , setTried ] = useState < CodeLine [ ] > ( [ ] ) ;
3131 const [ discovered , setDiscovered ] = useState < CodeLine [ ] > ( [ ] ) ;
32- const {
33- completeGame,
34- setCurrentContent,
35- isContentCompleted,
36- } = useProgressStore ( ) ;
32+ const { completeGame, setCurrentContent, isContentCompleted } =
33+ useProgressStore ( ) ;
3734
3835 const [ userSubHint , setUserSubHint ] = useState (
3936 < >
40- < Crosshair1Icon /> < span className = "pl-1" > Find the error</ span > { " " }
37+ < Crosshair1Icon className = "h-6 w-6" />
38+ < span className = "pl-2 text-2xl" > Find the error</ span >
4139 </ >
4240 ) ;
4341 // undefined nextHref will assign one if we find another game and if the players win.
@@ -75,10 +73,10 @@ export function CodeComponent(props: { game: Game }) {
7573 setFoundError ( true ) ;
7674 setUserSubHint (
7775 < >
78- < Crosshair2Icon /> { " " }
79- < span className = "pl-1 " >
80- Click on the line that fixes the problem.
81- </ span > { " " }
76+ < Crosshair2Icon className = "h-6 w-6" />
77+ < span className = "pl-2 text-2xl " >
78+ Click on the line that fixes the problem
79+ </ span >
8280 </ >
8381 ) ;
8482 }
@@ -109,8 +107,8 @@ export function CodeComponent(props: { game: Game }) {
109107 ) ;
110108 setUserSubHint (
111109 < >
112- { " " }
113- < CheckCircledIcon /> < span className = "pl-1 " > Congrats!</ span > { " " }
110+ < CheckCircledIcon className = "h-6 w-6" />
111+ < span className = "pl-2 text-2xl " > Congrats!</ span >
114112 </ >
115113 ) ;
116114 setFoundError ( false ) ;
@@ -121,7 +119,7 @@ export function CodeComponent(props: { game: Game }) {
121119 //find out why not interactive anymore.
122120 return (
123121 < div id = "rewardId" >
124- < div className = "flex items-center font-bold text-muted-foreground text-green-500 text-xl pt-4 " >
122+ < div className = "flex items-center font-bold text-muted-foreground text-green-900 py-6 px-4 bg-emerald-200 rounded-lg mb-4 shadow-sm " >
125123 { userSubHint }
126124 </ div >
127125 < div className = "flex flex-col bg-[#475266] p-1 rounded" >
@@ -141,7 +139,7 @@ export function CodeComponent(props: { game: Game }) {
141139
142140 const CustomPre = ( props : any ) => {
143141 const cn = "absolute top-3 right-3 text-white" ;
144- let icon = < span > </ span >
142+ let icon = < span > </ span > ;
145143 if (
146144 tried . includes ( cl ) &&
147145 ( cl . state == StateEnum . ERROR || StateEnum . CORRECT )
@@ -158,9 +156,20 @@ export function CodeComponent(props: { game: Game }) {
158156 return (
159157 < span
160158 className = { `relative group
161- ${ isCandidate && "border-2 border-l-4 rounded border-green-500 cursor-cell" }
162- ${ cl . state == StateEnum . NORMAL && foundError && "cursor-default blur-[0.8px] grayscale hover:translate-x-0" }
163- ${ cl . state == StateEnum . ERROR && foundError && "cursor-default hover:translate-x-0" }
159+ ${
160+ isCandidate &&
161+ "border-2 border-l-4 rounded border-green-500 cursor-cell"
162+ }
163+ ${
164+ cl . state == StateEnum . NORMAL &&
165+ foundError &&
166+ "cursor-default blur-[0.8px] grayscale hover:translate-x-0"
167+ }
168+ ${
169+ cl . state == StateEnum . ERROR &&
170+ foundError &&
171+ "cursor-default hover:translate-x-0"
172+ }
164173 ` }
165174 >
166175 < span
0 commit comments