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

Remove font-awesome and use react-icons #1065

Closed
Closed
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
59 changes: 41 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"express-naked-redirect": "^0.1.2",
"express-static-gzip": "^0.2.2",
"file-loader": "^1.1.11",
"font-awesome": "^4.7.0",
"react-icons": "^3.9.0",
"i18next": "^19.3.2",
"i18next-resource-store-loader": "^0.1.2",
Expand Down
3 changes: 2 additions & 1 deletion src/components/framework/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import marked from "marked";
import dompurify from "dompurify";
import styled from 'styled-components';
import { withTranslation } from "react-i18next";
import { FaDownload } from "react-icons/fa";
import { dataFont, medGrey, materialButton } from "../../globalStyles";
import { TRIGGER_DOWNLOAD_MODAL } from "../../actions/types";
import Flex from "./flex";
Expand Down Expand Up @@ -325,7 +326,7 @@ class Footer extends React.Component {
style={Object.assign({}, materialButton, {backgroundColor: "rgba(0,0,0,0)", color: medGrey, margin: 0, padding: 0})}
onClick={() => { this.props.dispatch({ type: TRIGGER_DOWNLOAD_MODAL }); }}
>
<i className="fa fa-download" aria-hidden="true"/>
<FaDownload />
<span style={{position: "relative"}}>{" "+t("Download data")}</span>
</button>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/framework/sidebar-chevron.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { FaChevronLeft } from "react-icons/fa";

const SidebarChevron = ({navHeight, navWidth, display, onClick}) => {
const chevronStyle = {
Expand All @@ -19,7 +20,7 @@ const SidebarChevron = ({navHeight, navWidth, display, onClick}) => {

return (
<div style={chevronStyle} onClick={onClick}>
<i className="fa fa-chevron-left" aria-hidden="true"/>
<FaChevronLeft />
</div>
);
};
Expand Down
13 changes: 7 additions & 6 deletions src/components/framework/sidebar-toggle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { FaTimes, FaChevronRight, FaChevronLeft, FaSlidersH } from "react-icons/fa";
import { goColor, sidebarColor } from "../../globalStyles";

/*
Expand Down Expand Up @@ -44,20 +45,20 @@ const SidebarToggle = ({sidebarOpen, mobileDisplay, handler}) => {
fontSize: mobileDisplay ? 26 : 12
};

let iconClass = "fa fa-close";
let icon = <FaTimes />;
if (sidebarOpen && !mobileDisplay) {
iconClass = "fa fa-chevron-left";
icon = <FaChevronLeft />;
} else if (!sidebarOpen && !mobileDisplay) {
iconClass = "fa fa-chevron-right";
icon = <FaChevronRight />;
} else if (sidebarOpen && mobileDisplay) {
iconClass = "fa fa-close";
icon = <FaTimes />;
} else if (!sidebarOpen && mobileDisplay) {
iconClass = "fa fa-sliders";
icon = <FaSlidersH />;
}

return (
<div style={containerStyle} onClick={handler}>
<div style={iconStyle}><i className={iconClass} aria-hidden="true"/></div>
<div style={iconStyle}>{icon}</div>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/narrative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from "react";
import { connect } from "react-redux";
import queryString from "query-string";
import Mousetrap from "mousetrap";
import { FaChevronUp, FaChevronDown } from "react-icons/fa";
import {
NarrativeStyles,
linkStyles,
Expand All @@ -16,7 +17,6 @@ import ReactPageScroller from "./ReactPageScroller";
import { changePage, EXPERIMENTAL_showMainDisplayMarkdown } from "../../actions/navigation";
import { CHANGE_URL_QUERY_BUT_NOT_REDUX_STATE } from "../../actions/types";
import { narrativeNavBarHeight } from "../../util/globals";
import { FaChevronUp, FaChevronDown } from "react-icons/fa";

/* regarding refs: https://reactjs.org/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components */
const progressHeight = 25;
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import configureStore from "./store";
import { initialiseGoogleAnalyticsIfRequired } from "./util/googleAnalytics";
import Root from "./root";
/* S T Y L E S H E E T S */
import "font-awesome/css/font-awesome.css";
import "leaflet/dist/leaflet.css";
import "leaflet-gesture-handling/dist/leaflet-gesture-handling.css";
import "./css/global.css";
Expand Down