Skip to content

Commit af8ab4c

Browse files
authored
Merge pull request #77 from CrackCode-dev/vidun-backup2
Added deployed mini games and update avatar route bug
2 parents f42f9d6 + 76a3701 commit af8ab4c

12 files changed

Lines changed: 7773 additions & 1062 deletions

File tree

crackcode/client/package-lock.json

Lines changed: 3262 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crackcode/client/package.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,42 @@
77
"dev": "vite",
88
"build": "vite build",
99
"lint": "eslint .",
10-
"preview": "vite preview"
10+
"preview": "vite preview",
11+
"test": "vitest",
12+
"test:watch": "vitest --watch",
13+
"test:ui": "vitest --ui"
1114
},
1215
"dependencies": {
1316
"@monaco-editor/react": "^4.7.0",
1417
"@tailwindcss/vite": "^4.1.18",
1518
"axios": "^1.13.2",
1619
"framer-motion": "^12.34.3",
1720
"lucide-react": "^0.562.0",
18-
"react": "^19.2.0",
19-
"react-dom": "^19.2.0",
21+
"react": "^18.3.0",
22+
"react-dom": "^18.3.0",
2023
"react-router-dom": "^7.11.0",
2124
"react-toastify": "^11.0.5",
2225
"tinycolor2": "^1.6.0"
2326
},
2427
"devDependencies": {
2528
"@eslint/js": "^9.39.1",
26-
"@types/react": "^19.2.5",
27-
"@types/react-dom": "^19.2.3",
29+
"@types/react": "^18.3.0",
30+
"@types/react-dom": "^18.3.0",
2831
"@vitejs/plugin-react": "^5.1.1",
2932
"eslint": "^9.39.1",
3033
"eslint-plugin-react-hooks": "^7.0.1",
3134
"eslint-plugin-react-refresh": "^0.4.24",
3235
"globals": "^16.5.0",
33-
"vite": "^7.2.4"
36+
"vite": "^7.2.4",
37+
"vitest": "^1.0.0",
38+
"@testing-library/react": "^14.3.0",
39+
"@testing-library/jest-dom": "^6.4.0",
40+
"@testing-library/user-event": "^14.5.0",
41+
"jsdom": "^22.0.0"
42+
},
43+
"vitest": {
44+
"testTimeout": 5000,
45+
"environment": "jsdom",
46+
"setupFiles": ["src/setupTests.js"]
3447
}
3548
}

crackcode/client/src/components/common/AppNavbar.jsx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from "react";
22
import { NavLink } from "react-router-dom";
33
import { useTheme } from "../../context/theme/ThemeContext";
4-
import { Settings, Bell, Search } from "lucide-react";
4+
import { Settings, Bell, Gamepad2 } from "lucide-react";
55
import CrackcodeLogo from "../../assets/logo/crackcode_logo.svg";
66

77
const NAV_TABS = [
@@ -77,23 +77,19 @@ export default function AppNavbar() {
7777
))}
7878
</nav>
7979

80-
{/* Right side: search + bell + settings */}
80+
{/* Right side: games button + bell + settings */}
8181
<div className="flex items-center gap-2 shrink-0">
8282

83-
{/* Search input */}
84-
<div className="relative hidden sm:block">
85-
<Search size={14} className="absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none" style={{ color: "var(--muted)" }} />
86-
<input
87-
placeholder="Search Cases..."
88-
className="w-48 pl-8 pr-3 py-2 rounded-xl text-sm border transition-shadow duration-200 focus:outline-none focus:ring-2"
89-
style={{
90-
background: "var(--surface2)",
91-
border: "1.5px solid var(--border)",
92-
color: "var(--text)",
93-
"--tw-ring-color": "rgba(255,150,68,0.3)",
94-
}}
95-
/>
96-
</div>
83+
{/* Games button */}
84+
<NavLink
85+
to="/home"
86+
className="flex items-center gap-2 px-4 py-2 rounded-xl font-semibold text-sm transition-opacity hover:opacity-70"
87+
style={{ color: "var(--text)" }}
88+
title="Brain Breaker Games"
89+
>
90+
<Gamepad2 size={16} />
91+
Games
92+
</NavLink>
9793

9894
{/* Bell */}
9995
<button

crackcode/client/src/components/common/Header.jsx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import logo_dark from "../../assets/logo/logo_dark.png";
66
import { useTheme } from '../../context/theme/ThemeContext'
77
import logo from "../../assets/logo/crackcode_logo.svg"
88
import Navbar from './Navbar'
9-
import { Bell } from 'lucide-react';
9+
import { Bell, Gamepad2 } from 'lucide-react';
1010
import Avatar from './Avatar';
1111
import HQBtn from './HQBtn';
1212
import BackBtn from './BackBtn';
@@ -115,28 +115,23 @@ const Header = ({ variant = "default", showBackBtn = true, showHQ = true }) => {
115115
{showHeaderActions && (
116116
<div className='flex items-center gap-4'>
117117

118-
{/* Search Bar */}
119-
<input
120-
name='search-bar'
121-
type="text"
122-
placeholder='Search Cases...'
123-
className='w-24 sm:w-32 text-xs sm:text-sm rounded-md px-2 py-1
124-
focus:outline-none focus:ring-1 focus:w-32 sm:focus:w-40
125-
transition-all duration-300 ease-in-out'
126-
style={{
127-
background: 'rgba(255, 165, 0, 0.1)',
128-
color: 'var(--text)',
129-
border: '1px solid var(--border)'
130-
}}
131-
onFocus={(e) => {
132-
e.target.style.boxShadow = '0 0 0 1px var(--brand)';
133-
e.target.style.background = 'rgba(255, 165, 0, 0.15)';
134-
}}
135-
onBlur={(e) => {
136-
e.target.style.boxShadow = 'none';
137-
e.target.style.background = 'rgba(255, 165, 0, 0.1)';
118+
{/* Games Button */}
119+
<Button
120+
variant="ghost"
121+
size="sm"
122+
onClick={() => {
123+
navigate('/home#brain-breaker');
124+
setTimeout(() => {
125+
const element = document.getElementById('brain-breaker');
126+
element?.scrollIntoView({ behavior: 'smooth', block: 'start' });
127+
}, 100);
138128
}}
139-
/>
129+
className='flex items-center gap-2 text-xs sm:text-sm font-semibold hover:bg-opacity-80'
130+
title="Brain Breaker Games"
131+
>
132+
<Gamepad2 className='w-4 h-4 sm:w-5 sm:h-5' />
133+
Games
134+
</Button>
140135

141136
{/* Settings Dropdown */}
142137
<SettingsDropdown />

0 commit comments

Comments
 (0)