Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added logo to navbar and removed all arrow navigation code #36

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/OurCode-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,6 @@ export const updateFilePath = (filePath) => {
};


/*
nav-bar navigation
*/


export const clickedOnForward = () => {
return {type: reduxStoreActions.action_click_forward};
};

export const clickedOnBack = () => {
return {type: reduxStoreActions.action_click_back};
};

/*
RulePad
*/
Expand Down
12 changes: 12 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,22 @@ body {
justify-content: center;
}

/*-- Nav bar --*/

.navbar {
margin-bottom: 0;
}

.navbar-brand {
display: flex;
align-items: center;
}

.navbar-icon {
width: 40px;
height: 40px;
}

/*!*** rule Generator GUI ***!*/

.guiBoundingBox {
Expand Down
39 changes: 10 additions & 29 deletions src/ui/navBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@

import React, {Component} from "react";
import "../App.css";
import {FaArrowLeft, FaArrowRight} from "react-icons/fa";
import {Nav, Navbar, NavItem} from "react-bootstrap";
import {connect} from "react-redux";
import {clickedOnBack, clickedOnForward} from "../actions";
import {hashConst} from "./uiConstants";
import {featureConfig} from "../config";

export class NavBar extends Component {
render() {
return (
<Navbar inverse collapseOnSelect
style={{backgroundColor: "transparent", backgroundImage: "none", border: "none"}}>
<Navbar.Toggle/>
<Navbar inverse collapseOnSelect style={{backgroundColor: "transparent", backgroundImage: "none", border: "none"}}>
<Navbar.Header>
<Navbar.Brand>
<a href="#/index">
<img src="/OurCode-icon.png" alt="Logo" className="navbar-icon grayscale"/>
</a>
</Navbar.Brand>
<Navbar.Toggle/>
</Navbar.Header>
<Navbar.Collapse>
<Nav
onSelect={(key) => {
Expand All @@ -26,12 +30,6 @@ export class NavBar extends Component {
(key === 3) ? `#/${hashConst.violatedRules}` : (key === 4) ? `#/${hashConst.learnDesignRules}` : `#/${hashConst.index}`;
}
}}>
<NavItem eventKey={-1} className={this.props.backDisable} onClick={() => this.props.backClick(this.props)}>
<FaArrowLeft size={20}/>
</NavItem>
<NavItem eventKey={-2} className={this.props.forwardDisable} onClick={() => this.props.forwardClick(this.props)}>
<FaArrowRight size={20}/>
</NavItem>

<NavItem eventKey={1}>
{"Table of Contents"}
Expand Down Expand Up @@ -62,21 +60,4 @@ function mapStateToProps(state) {
};
}

function mapDispatchToProps(dispatch) {
return {
backClick: (props) => {
if (props.activeHashIndex > 0) {
dispatch(clickedOnBack());
window.location.hash = props.history[props.activeHashIndex - 1];
}
},
forwardClick: (props) => {
if (props.activeHashIndex < props.history.length - 1) {
dispatch(clickedOnForward());
window.location.hash = props.history[props.activeHashIndex + 1];
}
},
};
}

export default connect(mapStateToProps, mapDispatchToProps)(NavBar);
export default connect(mapStateToProps)(NavBar);
Loading