Skip to content

Commit 88366b2

Browse files
committed
fix: css styles
* chore: linting files
1 parent 42b1b85 commit 88366b2

2 files changed

Lines changed: 65 additions & 37 deletions

File tree

web/src/components/student/InteractionBar.tsx

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
import { useState, useRef, useEffect } from 'react'
2-
import { RotateCcw, Settings, ChevronDown, Check, Code, BookOpen, MessageSquare } from 'lucide-react'
3-
import { cn } from '#/lib/utils.ts'
1+
import { useState, useRef, useEffect } from "react";
2+
import {
3+
RotateCcw,
4+
Settings,
5+
ChevronDown,
6+
Check,
7+
Code,
8+
BookOpen,
9+
MessageSquare,
10+
} from "lucide-react";
11+
import { cn } from "#/lib/utils.ts";
412

513
interface CodingBarProps {
6-
language: string
7-
setLanguage: (lang: string) => void
8-
fontSize: number
9-
setFontSize: (size: number) => void
10-
onResetClick: () => void
11-
isProblemCollapsed: boolean
12-
setIsProblemCollapsed: (collapsed: boolean) => void
13-
isChatCollapsed: boolean
14-
setIsChatCollapsed: (collapsed: boolean) => void
14+
language: string;
15+
setLanguage: (lang: string) => void;
16+
fontSize: number;
17+
setFontSize: (size: number) => void;
18+
onResetClick: () => void;
19+
isProblemCollapsed: boolean;
20+
setIsProblemCollapsed: (collapsed: boolean) => void;
21+
isChatCollapsed: boolean;
22+
setIsChatCollapsed: (collapsed: boolean) => void;
1523
}
1624

1725
const LANGUAGES = [
18-
{ id: 'python', name: 'Python 3' },
19-
{ id: 'javascript', name: 'JavaScript' },
20-
{ id: 'cpp', name: 'C++' },
21-
{ id: 'java', name: 'Java' },
22-
]
26+
{ id: "python", name: "Python 3" },
27+
// { id: 'javascript', name: 'JavaScript' },
28+
// { id: 'cpp', name: 'C++' },
29+
// { id: 'java', name: 'Java' },
30+
];
2331

24-
const FONT_SIZES = [12, 14, 16, 18]
32+
const FONT_SIZES = [12, 14, 16, 18];
2533

2634
export default function CodingBar({
2735
language,
@@ -34,27 +42,27 @@ export default function CodingBar({
3442
isChatCollapsed,
3543
setIsChatCollapsed,
3644
}: CodingBarProps) {
37-
const [isLangOpen, setIsLangOpen] = useState(false)
38-
const [isFontOpen, setIsFontOpen] = useState(false)
45+
const [isLangOpen, setIsLangOpen] = useState(false);
46+
const [isFontOpen, setIsFontOpen] = useState(false);
3947

40-
const langRef = useRef<HTMLDivElement>(null)
41-
const fontRef = useRef<HTMLDivElement>(null)
48+
const langRef = useRef<HTMLDivElement>(null);
49+
const fontRef = useRef<HTMLDivElement>(null);
4250

4351
// Close dropdowns when clicking outside
4452
useEffect(() => {
4553
function handleClickOutside(event: MouseEvent) {
4654
if (langRef.current && !langRef.current.contains(event.target as Node)) {
47-
setIsLangOpen(false)
55+
setIsLangOpen(false);
4856
}
4957
if (fontRef.current && !fontRef.current.contains(event.target as Node)) {
50-
setIsFontOpen(false)
58+
setIsFontOpen(false);
5159
}
5260
}
53-
document.addEventListener('mousedown', handleClickOutside)
54-
return () => document.removeEventListener('mousedown', handleClickOutside)
55-
}, [])
61+
document.addEventListener("mousedown", handleClickOutside);
62+
return () => document.removeEventListener("mousedown", handleClickOutside);
63+
}, []);
5664

57-
const currentLanguageName = LANGUAGES.find((l) => l.id === language)?.name || 'Python 3'
65+
const currentLanguageName = LANGUAGES.find((l) => l.id === language)?.name || "Python 3";
5866

5967
return (
6068
<div className="flex h-12 items-center justify-between border-b border-zinc-800 bg-zinc-900/95 px-4 text-sm text-zinc-300">
@@ -78,7 +86,16 @@ export default function CodingBar({
7886
{/* Mock Quest File Tab */}
7987
<div className="flex items-center gap-2 rounded-t-lg bg-zinc-950/80 px-3 py-1.5 text-xs font-semibold text-emerald-500 border border-zinc-800 border-b-transparent">
8088
<Code className="size-3.5" />
81-
<span>solution.{language === 'python' ? 'py' : language === 'javascript' ? 'js' : language === 'cpp' ? 'cpp' : 'java'}</span>
89+
<span>
90+
solution.
91+
{language === "python"
92+
? "py"
93+
: language === "javascript"
94+
? "js"
95+
: language === "cpp"
96+
? "cpp"
97+
: "java"}
98+
</span>
8299
</div>
83100

84101
<div className="h-4 w-px bg-zinc-800" />
@@ -90,7 +107,9 @@ export default function CodingBar({
90107
className="flex items-center gap-1.5 rounded-md bg-zinc-800/60 px-3 py-1.5 text-xs font-medium hover:bg-zinc-800 hover:text-zinc-100 transition-colors"
91108
>
92109
<span>{currentLanguageName}</span>
93-
<ChevronDown className={`size-3.5 transition-transform duration-200 ${isLangOpen ? 'rotate-180' : ''}`} />
110+
<ChevronDown
111+
className={`size-3.5 transition-transform duration-200 ${isLangOpen ? "rotate-180" : ""}`}
112+
/>
94113
</button>
95114

96115
{isLangOpen && (
@@ -99,8 +118,8 @@ export default function CodingBar({
99118
<button
100119
key={lang.id}
101120
onClick={() => {
102-
setLanguage(lang.id)
103-
setIsLangOpen(false)
121+
setLanguage(lang.id);
122+
setIsLangOpen(false);
104123
}}
105124
className="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 transition-colors"
106125
>
@@ -154,8 +173,8 @@ export default function CodingBar({
154173
<button
155174
key={size}
156175
onClick={() => {
157-
setFontSize(size)
158-
setIsFontOpen(false)
176+
setFontSize(size);
177+
setIsFontOpen(false);
159178
}}
160179
className="flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 transition-colors"
161180
>
@@ -184,6 +203,6 @@ export default function CodingBar({
184203
<MessageSquare className="size-3.5" />
185204
</button>
186205
</div>
187-
</div >
188-
)
189-
}
206+
</div>
207+
);
208+
}

web/src/styles.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@
118118
}
119119

120120
@theme inline {
121+
--color-sea-ink: var(--sea-ink);
122+
--color-sea-ink-soft: var(--sea-ink-soft);
123+
--color-lagoon: var(--lagoon);
124+
--color-lagoon-deep: var(--lagoon-deep);
125+
--color-palm: var(--palm);
126+
--color-sand: var(--sand);
127+
--color-foam: var(--foam);
128+
--color-line: var(--line);
129+
121130
--font-sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;
122131
--color-background: var(--background);
123132
--color-foreground: var(--foreground);

0 commit comments

Comments
 (0)