Skip to content

Commit

Permalink
Merge pull request #27 from RBP98/violatedRulesTooltipFix
Browse files Browse the repository at this point in the history
Fixed issue: [UI] Add a message for violated rules #13 and [UI] Add a description for All Rules page #12
  • Loading branch information
SaharMehrpour authored Sep 9, 2024
2 parents e353e85 + c647841 commit d4a23e7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

14 changes: 11 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ body {
}

/*** HeaderBar ***/

.headerDiv {
padding-bottom: 10px;
padding-top: 20px;
border-bottom: 3px double #bdbdbd
border-bottom: 3px double #bdbdbd;
display: flex;
align-items: center;
}

.text-24 {
Expand All @@ -234,6 +235,13 @@ body {
color: #5d5d5d;
}

.infoIcon {
margin-left: 10px;
position: relative;
top: 6px;
left: -5px;
}

/*!*** Auto Complete ***!*/

.monacoWrapper {
Expand Down Expand Up @@ -1041,4 +1049,4 @@ img.tutorialSmallImage {
.minedRulesComponent .identifierContainer .identifierHeader {
width: 100%;
margin: auto;
}
}
9 changes: 9 additions & 0 deletions src/ui/headerBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {connect} from "react-redux";
import {GoAlert} from "react-icons/go";
import {webSocketSendMessage} from "../core/coreConstants";
import {hashConst} from "./uiConstants";
import {FaInfoCircle} from "react-icons/fa";
import ReactTooltip from "react-tooltip";

export class HeaderBar extends Component {
render() {
Expand All @@ -22,6 +24,8 @@ export class HeaderBar extends Component {
)}
<div className="headerDiv">
{this.renderHeader()}
<ReactTooltip place="top" type="dark" effect="float" />
<FaInfoCircle className="infoIcon" data-tip={this.props.tooltip} />
</div>
</div>
);
Expand Down Expand Up @@ -126,6 +130,7 @@ function mapStateToProps(state) {
tag: "",
title: "",
content: "",
tooltip: "",
};

switch (state.currentHash[0]) {
Expand All @@ -140,6 +145,7 @@ function mapStateToProps(state) {
break;
case hashConst.rules:
props.title = "All Rules";
props.tooltip = "View and manage all documentation rules.";
break;
case hashConst.tagJsonChanged:
props.title = "tagTable.json is changed.";
Expand All @@ -149,9 +155,11 @@ function mapStateToProps(state) {
break;
case hashConst.index:
props.title = "Active Documentation";
props.tooltip = "View the main index of the Active Documentation.";
break;
case hashConst.violatedRules:
props.title = "Violated Rules";
props.tooltip = "Review all rules that have been violated.";
break;
case hashConst.rulesForFile:
props.content = state.openFilePath.replace(state.projectPath, "");
Expand All @@ -162,6 +170,7 @@ function mapStateToProps(state) {
break;
case hashConst.learnDesignRules:
props.title = "Learn Design Rules";
props.tooltip="Explore and learn about design rules.";
break;
default:
props.content = "Error no page is found for: " + state.currentHash[0];
Expand Down

0 comments on commit d4a23e7

Please sign in to comment.