Skip to content

Commit

Permalink
chore: add logo to navbar, remove from dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjitRaman committed Jun 16, 2024
1 parent 1d94e69 commit 8ecde0f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
12 changes: 12 additions & 0 deletions server/website/src/components/Navbar.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Navbar.css */
.navbar {
background-color: #fff;
border-bottom: 1px solid #ddd;
Expand Down Expand Up @@ -37,6 +38,17 @@
color: black;
}

.logo-container {
flex: 1;
display: flex;
justify-content: center;
}

.navbar-logo {
height: 40px;
/* Adjust the height as needed */
}

.login-container {
display: flex;
align-items: center;
Expand Down
4 changes: 4 additions & 0 deletions server/website/src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { NavLink } from 'react-router-dom';
import './Navbar.css';
import { handleLoginSubmit as login } from '../utils/loginUtils';
import { GlobalContext } from '../context/GlobalState';
import logo from '../images/logo.png'; // Import the logo

const Navbar = () => {
const [botId, setBotId] = useState('');
Expand Down Expand Up @@ -36,6 +37,9 @@ const Navbar = () => {
</NavLink>
</li>
</ul>
<div className="logo-container">
<img src={logo} alt="logo" className="navbar-logo" />
</div>
<div className="login-container">
<form onSubmit={handleLogin} className="login-form">
<input
Expand Down
8 changes: 5 additions & 3 deletions server/website/src/pages/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// src/components/Dashboard.js
import React, { useState, useEffect, useContext } from 'react';
import './Dashboard.css';
import CanvasJSReact from '@canvasjs/react-charts';
Expand All @@ -7,8 +8,8 @@ import { initializeMQTT, sendTuning, sendPingMessage } from '../utils/mqttServic
import { GlobalContext } from '../context/GlobalState';
import BatteryGraph from '../components/BatteryGraph';
import PowerGraph from '../components/PowerGraph';
import logo from '../images/logo.png';

// Remove this line
// import logo from '../images/logo.png';

const CanvasJSChart = CanvasJSReact.CanvasJSChart;

Expand Down Expand Up @@ -195,7 +196,8 @@ const Dashboard = () => {
<h2>Server Connection</h2>
<button className="test-button" onClick={handlePingTest}>Test Server Connectivity</button>
<p>RTT: {rtt !== null ? `${rtt} ms` : '-- ms'}</p>
<img src={logo} alt='logo' className='logo' /> {/* Use the imported image */}
{/* Remove this line */}
{/* <img src={logo} alt='logo' className='logo' /> */}
</div>
</div>
</div>
Expand Down

0 comments on commit 8ecde0f

Please sign in to comment.