Skip to content

Commit 8a03aba

Browse files
Varun-Choudharyhasura-bot
authored andcommitted
CON-159-Swap to react icons in the main layout (/main + /login)
PR-URL: hasura/graphql-engine-mono#4455 GitOrigin-RevId: bfbef97761174182bbab13d2390d0646b848ac17
1 parent db07dcf commit 8a03aba

5 files changed

Lines changed: 32 additions & 18 deletions

File tree

console/src/components/Login/Login.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, ChangeEvent, FormEvent } from 'react';
22
import { Connect } from 'react-redux';
33
import { push } from 'react-router-redux';
44
import Helmet from 'react-helmet';
5+
import { FaSpinner } from 'react-icons/fa';
56
import Button from '../Common/Button/Button';
67
import globals from '../../Globals';
78
import { verifyLogin } from './Actions';
@@ -31,7 +32,7 @@ const Login: React.FC<ConnectInjectedProps> = ({ dispatch }) => {
3132
loginText = (
3233
<span>
3334
Verifying...
34-
<i className="fa fa-spinner fa-spin" aria-hidden="true" />
35+
<FaSpinner className="animate-spin" />
3536
</span>
3637
);
3738
} else if (error) {

console/src/components/Main/LoveSection.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import { FaHeart, FaStar, FaTimes, FaTwitter } from 'react-icons/fa';
23
import styles from './Main.scss';
34
import PixelHeart from './images/components/PixelHeart';
45
import globals from '../../Globals';
@@ -23,7 +24,7 @@ const LoveSection: React.FC<LoveSectionProps> = ({
2324
<ul key="main_love_2" className={`dropdown-menu ${styles.dropdown_menu}`}>
2425
<div className={styles.dropdown_menu_container}>
2526
<div className={styles.closeDropDown}>
26-
<i className="fa fa-close" onClick={closeLoveSection} />
27+
<FaTimes onClick={closeLoveSection} />
2728
</div>
2829
<div className={styles.displayFlex}>
2930
<li className={styles.pixelText1}>
@@ -32,7 +33,7 @@ const LoveSection: React.FC<LoveSectionProps> = ({
3233
<br />
3334
Star us on GitHub,
3435
<br />
35-
To make our <i className="fa fa-heart" /> go wooooo!
36+
To make our <FaHeart /> go wooooo!
3637
</li>
3738
<li className="dropdown-item">
3839
<a
@@ -48,7 +49,7 @@ const LoveSection: React.FC<LoveSectionProps> = ({
4849
/>
4950
</div>
5051
<div className={styles.pixelText}>
51-
<i className="fa fa-star" />
52+
<FaStar />
5253
&nbsp; Star
5354
</div>
5455
</a>
@@ -67,7 +68,7 @@ const LoveSection: React.FC<LoveSectionProps> = ({
6768
/>
6869
</div>
6970
<div className={styles.pixelText}>
70-
<i className="fa fa-twitter" />
71+
<FaTwitter />
7172
&nbsp; Tweet
7273
</div>
7374
</a>

console/src/components/Main/Main.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ import React from 'react';
22

33
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
44
import Tooltip from 'react-bootstrap/lib/Tooltip';
5+
import {
6+
FaCloud,
7+
FaCog,
8+
FaCogs,
9+
FaDatabase,
10+
FaExclamationCircle,
11+
FaFlask,
12+
FaPlug,
13+
} from 'react-icons/fa';
514
import { connect } from 'react-redux';
615
import { Link } from 'react-router';
716

@@ -285,15 +294,15 @@ class Main extends React.Component {
285294

286295
const getMetadataStatusIcon = () => {
287296
if (metadata.inconsistentObjects.length === 0) {
288-
return <i className={styles.question + ' fa fa-cog'} />;
297+
return <FaCog className={styles.question} />;
289298
}
290299
return (
291300
<div className={styles.question}>
292-
<i className={'fa fa-cog'} />
301+
<FaCog />
293302
<div className={styles.overlappingExclamation}>
294303
<div className={styles.iconWhiteBackground} />
295304
<div>
296-
<i className={'fa fa-exclamation-circle'} />
305+
<FaExclamationCircle />
297306
</div>
298307
</div>
299308
</div>
@@ -351,7 +360,9 @@ class Main extends React.Component {
351360
data-test={`${title.toLowerCase()}-tab-link`}
352361
>
353362
<div className={styles.iconCenter} data-test={block}>
354-
<i className={`fa ${icon}`} aria-hidden="true" />
363+
{React.createElement(icon, {
364+
'aria-hidden': true,
365+
})}
355366
</div>
356367
<p>{title}</p>
357368
</Link>
@@ -385,14 +396,14 @@ class Main extends React.Component {
385396
<ul className={styles.sidebarItems}>
386397
{getSidebarItem(
387398
'API',
388-
'fa-flask',
399+
FaFlask,
389400
tooltips.apiExplorer,
390401
'/api/api-explorer',
391402
true
392403
)}
393404
{getSidebarItem(
394405
'Data',
395-
'fa-database',
406+
FaDatabase,
396407
tooltips.data,
397408
currentSource
398409
? schemaList.length
@@ -402,19 +413,19 @@ class Main extends React.Component {
402413
)}
403414
{getSidebarItem(
404415
'Actions',
405-
'fa-cogs',
416+
FaCogs,
406417
tooltips.actions,
407418
'/actions/manage/actions'
408419
)}
409420
{getSidebarItem(
410421
'Remote Schemas',
411-
'fa-plug',
422+
FaPlug,
412423
tooltips.remoteSchema,
413424
'/remote-schemas/manage/schemas'
414425
)}{' '}
415426
{getSidebarItem(
416427
'Events',
417-
'fa-cloud',
428+
FaCloud,
418429
tooltips.events,
419430
'/events/data/manage'
420431
)}

console/src/components/Main/Main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@
543543
.navSideBarActive {
544544
border-bottom: 4px solid #ffc627;
545545

546-
i {
546+
svg {
547547
color: #ffc627;
548548
}
549549

console/src/components/Main/NotificationSection.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { ComponentProps } from 'react';
22
import { connect, ConnectedProps } from 'react-redux';
3+
import { FaArrowRight, FaBell, FaTimes } from 'react-icons/fa';
34

45
import { Box, Flex, Heading, Text, Badge } from '../UIKit/atoms';
56
import {
@@ -191,7 +192,7 @@ const Notification: React.FC<UpdateProps> = ({
191192
target="_blank"
192193
rel="noopener noreferrer"
193194
>
194-
<i className={`fa fa-arrow-right ${styles.linkArrow}`} />
195+
<FaArrowRight className={styles.linkArrow} />
195196
</a>
196197
</div>
197198
) : null}
@@ -729,7 +730,7 @@ const HasuraNotifications: React.FC<
729730
onClick={onClickNotificationButton}
730731
ref={wrapperRef}
731732
>
732-
<i className={`fa fa-bell ${styles.bellIcon}`} />
733+
<FaBell className={styles.bellIcon} />
733734
<ToReadBadge
734735
numberNotifications={numberNotifications}
735736
show={showBadge || !!fixedVersion}
@@ -763,7 +764,7 @@ const HasuraNotifications: React.FC<
763764
className={styles.closeNotificationIcon}
764765
onClick={onClickOutside}
765766
>
766-
<i className="fa fa-times" />
767+
<FaTimes />
767768
</div>
768769
</Flex>
769770
<Box className={styles.notificationsContainer}>

0 commit comments

Comments
 (0)