Skip to content

Commit 63ec82b

Browse files
committed
added workflow pipline
1 parent eccc67f commit 63ec82b

5 files changed

Lines changed: 65 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
ci:
11+
name: CI Check (Lint & Build)
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run Linter
28+
run: npm run lint
29+
30+
- name: Build Application
31+
run: npm run build

eslint.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ export default defineConfig([
1717
globals: globals.browser,
1818
parserOptions: { ecmaFeatures: { jsx: true } },
1919
},
20+
rules: {
21+
'no-unused-vars': 'warn',
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true }
25+
],
26+
},
2027
},
2128
])

src/components/layout/Navbar.jsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => {
99
const [notifications, setNotifications] = useState(mockNotifications);
1010
const [showNotifications, setShowNotifications] = useState(false);
1111
const [searchQuery, setSearchQuery] = useState("");
12-
const [greeting, setGreeting] = useState("Hello");
12+
const greeting = (() => {
13+
const hours = new Date().getHours();
14+
if (hours < 12) return "Good morning";
15+
if (hours < 18) return "Good afternoon";
16+
return "Good evening";
17+
})();
1318
const notificationRef = useRef(null);
1419
const navigate = useNavigate();
1520

@@ -24,14 +29,6 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => {
2429
return () => document.removeEventListener("mousedown", handleClickOutside);
2530
}, []);
2631

27-
// Determine animated time greeting
28-
useEffect(() => {
29-
const hours = new Date().getHours();
30-
if (hours < 12) setGreeting("Good morning");
31-
else if (hours < 18) setGreeting("Good afternoon");
32-
else setGreeting("Good evening");
33-
}, []);
34-
3532
const unreadCount = notifications.filter((n) => !n.read).length;
3633

3734
const markAllAsRead = () => {

src/pages/Dashboard.jsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,27 @@ import RankPreview from "../components/dashboard/RankPreview";
1010
import ActivityFeed from "../components/dashboard/ActivityFeed";
1111
import GradientButton from "../components/ui/GradientButton";
1212

13-
export const Dashboard = () => {
14-
// Generate dummy data for GitHub contribution graph mockup
15-
// 52 weeks * 7 days = 364 cells. We'll show a compact 24-column grid (168 cells) for responsiveness.
16-
const heatmapColors = [
17-
"bg-slate-100 dark:bg-slate-800/40", // 0 contributions
18-
"bg-violet-500/10 dark:bg-violet-500/10", // low
19-
"bg-violet-500/30 dark:bg-violet-500/30", // medium-low
20-
"bg-violet-500/60 dark:bg-violet-500/50", // medium-high
21-
"bg-violet-600 dark:bg-violet-600" // high
22-
];
13+
// Generate dummy data for GitHub contribution graph mockup
14+
// 52 weeks * 7 days = 364 cells. We'll show a compact 24-column grid (168 cells) for responsiveness.
15+
const heatmapColors = [
16+
"bg-slate-100 dark:bg-slate-800/40", // 0 contributions
17+
"bg-violet-500/10 dark:bg-violet-500/10", // low
18+
"bg-violet-500/30 dark:bg-violet-500/30", // medium-low
19+
"bg-violet-500/60 dark:bg-violet-500/50", // medium-high
20+
"bg-violet-600 dark:bg-violet-600" // high
21+
];
22+
23+
const heatmapCells = Array.from({ length: 168 }, () => {
24+
// Weighted distribution to look like actual active coding
25+
const rand = Math.random();
26+
if (rand < 0.35) return 0;
27+
if (rand < 0.65) return 1;
28+
if (rand < 0.8) return 2;
29+
if (rand < 0.93) return 3;
30+
return 4;
31+
});
2332

24-
const heatmapCells = Array.from({ length: 168 }, () => {
25-
// Weighted distribution to look like actual active coding
26-
const rand = Math.random();
27-
if (rand < 0.35) return 0;
28-
if (rand < 0.65) return 1;
29-
if (rand < 0.8) return 2;
30-
if (rand < 0.93) return 3;
31-
return 4;
32-
});
33+
export const Dashboard = () => {
3334

3435
const challenges = [
3536
{

src/pages/Login.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const Login = () => {
4343

4444
{/* Back to Home */}
4545
<div className="flex justify-start -mb-2">
46-
46+
<a
4747
href="/"
4848
className="group flex items-center gap-1 text-xs text-slate-400 hover:text-violet-400 transition-colors duration-200 font-semibold"
4949
>

0 commit comments

Comments
 (0)