File tree Expand file tree Collapse file tree 4 files changed +28
-15
lines changed Expand file tree Collapse file tree 4 files changed +28
-15
lines changed Original file line number Diff line number Diff line change
1
+ import TypingCode from "@/components/typing/typingCode" ;
2
+
3
+ export default async function Race ( ) {
4
+ return (
5
+ < >
6
+ < main className = "flex min-h-screen flex-col items-center justify-between p-24" >
7
+ < TypingCode />
8
+ </ main >
9
+ </ >
10
+ ) ;
11
+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const Header = () => {
10
10
const [ state , setState ] = useState ( false ) ;
11
11
12
12
const navigation = [
13
- { title : "Race" , path : "/" } ,
13
+ { title : "Race" , path : "/race " } ,
14
14
{ title : "Leaderboard" , path : "/" } ,
15
15
{ title : "About" , path : "/" } ,
16
16
] ;
Original file line number Diff line number Diff line change 1
- import React from ' react'
1
+ import React from " react" ;
2
2
3
3
interface displayCodeProps {
4
4
code : string ;
@@ -8,16 +8,16 @@ interface displayCodeProps {
8
8
export default function DisplayedCode ( { code, errors } : displayCodeProps ) {
9
9
return (
10
10
< p className = "text-gray-600 mb-4" >
11
- { code . split ( "" ) . map ( ( char , index ) => (
12
- < span
13
- key = { index }
14
- className = { `${
15
- errors . includes ( index ) ? "text-red-500" : "opacity-100"
16
- } `}
17
- >
18
- { char }
19
- </ span >
20
- ) ) }
21
- </ p >
22
- )
11
+ { code . split ( "" ) . map ( ( char , index ) => (
12
+ < span
13
+ key = { index }
14
+ className = { `${
15
+ errors . includes ( index ) ? "text-red-500" : "opacity-100"
16
+ } `}
17
+ >
18
+ { char }
19
+ </ span >
20
+ ) ) }
21
+ </ p >
22
+ ) ;
23
23
}
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
+
2
3
import { useState , useEffect } from "react" ;
4
+
3
5
import DisplayedCode from "./displayedCode" ;
4
6
5
- const code = ' printf("hello world")' ;
7
+ const code = ` printf("hello world")` ;
6
8
7
9
export default function TypingCode ( ) {
8
10
const [ input , setInput ] = useState ( "" ) ;
You can’t perform that action at this time.
0 commit comments