Coder Social home page Coder Social logo

Navbar icons are not showing . I have installed both overlay-navbar and react-icons. Can you help me please ? about mernprojectecommerce HOT 7 OPEN

alalUDDIN123 avatar alalUDDIN123 commented on September 15, 2024
Navbar icons are not showing . I have installed both overlay-navbar and react-icons. Can you help me please ?

from mernprojectecommerce.

Comments (7)

rajgorhetal avatar rajgorhetal commented on September 15, 2024 4

Update your header.js with below code. This will solve the problem

import React from 'react';
import { ReactNavbar } from 'overlay-navbar';
import { MdAccountCircle } from 'react-icons/md';
import { MdSearch } from 'react-icons/md';
import { MdAddShoppingCart } from 'react-icons/md';
import logo from '../../../images/logo.png';

const options = {
burgerColorHover: '#eb4034',
logo,
logoWidth: '20vmax',
navColor1: 'white',
logoHoverSize: '10px',
logoHoverColor: '#eb4034',
link1Text: 'Home',
link2Text: 'Products',
link3Text: 'Contact Us',
link4Text: 'About Us',
link1Url: '/',
link2Url: '/products',
link3Url: '/contact',
link4Url: '/about',
link1Size: '1.3vmax',
link1Color: 'rgba(35, 35, 35,0.8)',
nav1justifyContent: 'flex-end',
nav2justifyContent: 'flex-end',
nav3justifyContent: 'flex-start',
nav4justifyContent: 'flex-start',
link1ColorHover: '#eb4034',
link1Margin: '1vmax',
profileIcon: true,
profileIconColor: 'rgba(35, 35, 35,0.8)',
profileIconUrl: '/login',
ProfileIconElement: MdAccountCircle,
searchIcon: true,
searchIconColor: 'rgba(35, 35, 35,0.8)',
SearchIconElement: MdSearch,
cartIcon: true,
cartIconColor: 'rgba(35, 35, 35,0.8)',
CartIconElement: MdAddShoppingCart,
profileIconColorHover: '#eb4034',
searchIconColorHover: '#eb4034',
cartIconColorHover: '#eb4034',
cartIconMargin: '1vmax',
};

const Header = () => {
return <ReactNavbar {...options} />;
};

export default Header;

from mernprojectecommerce.

alalUDDIN123 avatar alalUDDIN123 commented on September 15, 2024 2

six programmer

Showing like this

from mernprojectecommerce.

TOSEEB avatar TOSEEB commented on September 15, 2024 1

did you got solution for this

from mernprojectecommerce.

sk394 avatar sk394 commented on September 15, 2024 1

This helps me:
<ReactNavbar searchIcon = {true} SearchIconElement = {MdSearch} profileIcon = {true} ProfileIconElement = {MdAccountCircle} cartIcon = {true} CartIconElement = {MdShoppingCart} {...options} /> </div>

from mernprojectecommerce.

rajgorhetal avatar rajgorhetal commented on September 15, 2024

six programmer

Showing like this

Please check above comment

from mernprojectecommerce.

HetMamtora avatar HetMamtora commented on September 15, 2024

I have just started with Front-End part of E-Commerce project and compilation is going 100% successful but Navbar is not visible on react page. It's completely a blank page. Someone please help me to resolve this issue.

React App

Here are the snapshots of code.

Header.js
AppJS

App.js
HeaderJS

Index.js
IndexJS

Package.json
Package

I've force installed some of the packages using --legacy-peer-deps because the project is old and some of the libraries are deprecated but still usable as per the info from stackoverflow.

from mernprojectecommerce.

HetMamtora avatar HetMamtora commented on September 15, 2024

I have just started with Front-End part of E-Commerce project and compilation is going 100% successful but Navbar is not visible on react page. It's completely a blank page. Someone please help me to resolve this issue.

React App

Here are the snapshots of code.

Header.js AppJS

App.js HeaderJS

Index.js IndexJS

Package.json Package

I've force installed some of the packages using --legacy-peer-deps because the project is old and some of the libraries are deprecated but still usable as per the info from stackoverflow.

SOLVED !
I updated to new format of index.js I was using the older one.

index.js(UPDATED)
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';

const root = ReactDOM.createRoot(
document.getElementById('root')
);
root.render(

)

from mernprojectecommerce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.