Skip to content

Commit

Permalink
Merge pull request #350 from prabalsingh24/react-fontawesome-BB373
Browse files Browse the repository at this point in the history
BB-373, BB-386:  React fontawesome : entity image and final cleanup
  • Loading branch information
MonkeyDo committed Apr 8, 2020
2 parents 824ba66 + 814d91a commit c3949ec
Show file tree
Hide file tree
Showing 17 changed files with 146 additions and 3,221 deletions.
259 changes: 102 additions & 157 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"react-chartjs-2": "^2.9.0",
"react-datepicker": "^2.7.0",
"react-dom": "^16.2.0",
"react-fontawesome": "^1.5.0",
"react-redux": "^5.0.2",
"react-select": "^1.1.0",
"react-sticky": "^6.0.1",
Expand Down
1 change: 0 additions & 1 deletion scripts/copy-client-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

cp -R node_modules/bootstrap/less/ src/client/stylesheets/bootstrap
cp -R node_modules/@fortawesome/fontawesome-free/less/ src/client/stylesheets/font-awesome
cp -R node_modules/react-select/less/ src/client/stylesheets/react-select
cp -R node_modules/react-virtualized-select/styles.css static/stylesheets/react-virtualized-select.css
cp -R node_modules/react-virtualized/styles.css static/stylesheets/react-virtualized.css
Expand Down
46 changes: 21 additions & 25 deletions src/client/components/pages/entities/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import * as bootstrap from 'react-bootstrap';

import Icon from 'react-fontawesome';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import PropTypes from 'prop-types';
import React from 'react';

Expand All @@ -35,38 +35,34 @@ function EntityImage({backupIcon, deleted, imageUrl}) {
);
}

let icons;
if (deleted) {
icons = [
<Icon
key="entityIcon"
name={backupIcon}
size="5x"
stack="1x"
/>,
<Icon
key="deletedIcon"
name="slash"
size="5x"
stack="1x"
/>
];
}
else {
icons = (
<Icon
name={backupIcon}
size="5x"
/>
);
return (
<div className="entity-display-icon fa-layers fa-fw">
<FontAwesomeIcon
icon={backupIcon}
key="entityIcon"
size="5x"
stack="1x"
/>,
<FontAwesomeIcon
icon="slash"
key="deletedIcon"
size="5x"
stack="1x"
/>
</div>);
}

return (
<div className="entity-display-icon">
{icons}
<FontAwesomeIcon
icon={backupIcon}
size="5x"
/>
</div>
);
}

EntityImage.displayName = 'EntityImage';
EntityImage.propTypes = {
backupIcon: PropTypes.string.isRequired,
Expand Down
7 changes: 5 additions & 2 deletions src/client/helpers/setupIconLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import {fab} from '@fortawesome/free-brands-svg-icons';


// Disable FontAwesome's CSS (to prevent FOUC)
config.autoAddCss = false;
// For this, th build system needs to be able to import the css file below. Currently the build errors.
// import '@fortawesome/fontawesome-svg-core/styles.css';
// config.autoAddCss = false;

config.autoAddCss = true;

// Add Icons to FontAwesome library
library.add(
Expand Down
22 changes: 18 additions & 4 deletions src/client/stylesheets/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/

@import "lobes/less/theme.less";
@import "font-awesome/fontawesome.less";
@import "font-awesome/solid.less";
@import "react-select/select.less";


Expand All @@ -29,8 +27,7 @@ With Webpack and less-loader,
we should be able to import directly from node_modules directory with '~'.
The production configuration for webpack needs to be finalized before using this.
*/
/* @import "~@fortawesome/fontawesome-free/less/fontawesome.less";
/* @import "~@fortawesome/fontawesome-free/less/solid.less";
/*
@import "~react-select/less/select.less";
@import "~react-virtualized/styles.css";
@import "~react-virtualized-select/styles.css";
Expand Down Expand Up @@ -208,6 +205,22 @@ body {
height: 1em;
vertical-align: -.125em;
}
.fa-layers {
display: inline-block;
height: 1em;
position: relative;
text-align: center;
vertical-align: -0.125em;
min-width: 1em;
svg.svg-inline--fa {
bottom: 0;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
}
}

/* Sticky footer styling */
html {
Expand Down Expand Up @@ -321,6 +334,7 @@ html {
line-height: initial;
margin-top: 5em;
margin-bottom: 5em;
width: 100%;
>:last-child:not(:only-child) {
color: @brand-danger;
}
Expand Down
Binary file removed static/webfonts/.DS_Store
Binary file not shown.
Binary file removed static/webfonts/fa-regular-400.eot
Binary file not shown.
467 changes: 0 additions & 467 deletions static/webfonts/fa-regular-400.svg

This file was deleted.

Binary file removed static/webfonts/fa-regular-400.ttf
Binary file not shown.
Binary file removed static/webfonts/fa-regular-400.woff
Binary file not shown.
Binary file removed static/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file removed static/webfonts/fa-solid-900.eot
Binary file not shown.
2,564 changes: 0 additions & 2,564 deletions static/webfonts/fa-solid-900.svg

This file was deleted.

Binary file removed static/webfonts/fa-solid-900.ttf
Binary file not shown.
Binary file removed static/webfonts/fa-solid-900.woff
Binary file not shown.
Binary file removed static/webfonts/fa-solid-900.woff2
Binary file not shown.

0 comments on commit c3949ec

Please sign in to comment.