Skip to content

Commit 7868d90

Browse files
authored
Merge pull request #94 from iamnikhilranjan/dev
fix: logo not showing in production
2 parents e78f6b9 + ce9f8b8 commit 7868d90

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

components/associations/Associations.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useRef } from 'react';
2-
import Image from 'next/image';
2+
// import Image from 'next/image';
33
import Styles from './association.module.css';
44
import BottomGlitter from '../StyledText/BottomGlitter';
55

@@ -14,32 +14,26 @@ function Associations() {
1414
<div className={Styles.associationMenu}>
1515
<div className={Styles.associationMenuItem}>
1616
<a href="#gdsc">
17-
<Image
17+
<img
1818
className={Styles.associationImage}
19-
height="100%"
20-
width="100%"
2119
src="/sponsors/gdsc.png"
2220
alt="Google Developers Student Clubs, BIT Sindri"
2321
/>
2422
</a>
2523
</div>
2624
<div className={Styles.associationMenuItem}>
2725
<a href="#gfg">
28-
<Image
26+
<img
2927
className={Styles.associationImage}
30-
height="100%"
31-
width="100%"
3228
src="/sponsors/gfg.png"
3329
alt="GeeksForGeeks Student Chapter, BIT Sindri"
3430
/>
3531
</a>
3632
</div>
3733
<div className={Styles.associationMenuItem}>
3834
<a href="#codechef">
39-
<Image
35+
<img
4036
className={Styles.associationImage}
41-
height="100%"
42-
width="100%"
4337
src="/sponsors/codechef.jpg"
4438
alt="Codechef Student Chapter, BIT Sindri"
4539
/>

components/navbar/Navbar.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/* eslint-disable no-alert */
22
import React, { useEffect, useState } from 'react';
33
import { HiMenuAlt4 } from 'react-icons/hi';
4-
import Image from 'next/image';
54
import Link from 'next/link';
65
import styles from './Navbar.module.css';
7-
import Logo from '../../assets/hncc-logo.png';
6+
// ✅ Fixed: use logo directly with <img> instead of next/image for Netlify
87
import Button from '../button/Button';
98
import Sidebar from './Sidebar';
109

10+
const Logo = '/hncc-logo.png';
11+
1112
const SpanStyle = {
1213
zIndex: 1,
1314
color: 'inherit',
@@ -61,7 +62,15 @@ function Navbar() {
6162
<div>
6263
<Link href="/">
6364
<a className="flex items-center">
64-
<Image src={Logo} alt="HnCC" height="60px" width="60px" />
65+
{/* ✅ Fixed: using <img> ensures it loads correctly from public on Netlify */}
66+
<img
67+
src={Logo}
68+
alt="HnCC"
69+
height="60"
70+
width="60"
71+
className="mr-2"
72+
style={{ objectFit: 'contain' }}
73+
/>
6574
<h2 id="hnccTitle" className={styles.navTitle}>
6675
Hackathon and Coding Club
6776
</h2>

components/navbar/Sidebar.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { useEffect, useRef, useState } from 'react';
22
import { createPortal } from 'react-dom';
33
import { CgClose } from 'react-icons/cg';
4-
import Image from 'next/image';
54
import Link from 'next/link';
65
import styles from './Hamburger.module.css';
7-
import Logo from '../../assets/hncc-logo.png';
6+
// ✅ Fixed: use logo directly with <img> instead of next/image for Netlify
87
import Button from '../button/Button';
98

9+
const Logo = '/hncc-logo.png';
10+
1011
const SpanStyle = {
1112
zIndex: 1,
1213
color: 'inherit',
@@ -65,7 +66,15 @@ function Sidebar({ isMounted, unmount }) {
6566
<div>
6667
<Link href="/">
6768
<a className="flex items-center" onClick={unmount}>
68-
<Image src={Logo} alt="HnCC" height="60px" width="60px" />
69+
{/* ✅ Fixed: use <img> for Netlify compatibility */}
70+
<img
71+
src={Logo}
72+
alt="HnCC"
73+
height="60"
74+
width="60"
75+
className="mr-2"
76+
style={{ objectFit: 'contain' }}
77+
/>
6978
</a>
7079
</Link>
7180
</div>

0 commit comments

Comments
 (0)