Skip to content

Commit 8a403e1

Browse files
authored
Switch to FontAwesome icons (#16)
1 parent 4b2390a commit 8a403e1

File tree

13 files changed

+120
-106
lines changed

13 files changed

+120
-106
lines changed

icons/forbidden.svg

Lines changed: 0 additions & 2 deletions
This file was deleted.

icons/raised_hand.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"dependencies": {
6060
"@100mslive/react-sdk": "^0.10.3",
6161
"@ar-js-org/ar.js": "^3.4.5",
62+
"@fortawesome/fontawesome-svg-core": "^6.5.2",
63+
"@fortawesome/free-regular-svg-icons": "^6.5.2",
64+
"@fortawesome/free-solid-svg-icons": "^6.5.2",
65+
"@fortawesome/react-fontawesome": "latest",
6266
"@jupyterlab/application": "^4.1.4",
6367
"@jupyterlab/apputils": "^4.2.4",
6468
"@jupyterlab/coreutils": "^6.0.0",

src/components/ControlBar.tsx

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import {
66
useHMSActions,
77
useHMSStore
88
} from '@100mslive/react-sdk';
9+
import {} from '@fortawesome/free-regular-svg-icons';
10+
import {
11+
faMicrophone,
12+
faMicrophoneSlash,
13+
faPersonThroughWindow,
14+
faVideo,
15+
faVideoSlash
16+
} from '@fortawesome/free-solid-svg-icons';
17+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
918
import React, { useEffect } from 'react';
1019
import PluginButton from './buttons/PluginButton';
1120
import RaiseHandButton from './buttons/RaiseHandButton';
@@ -35,11 +44,22 @@ const ControlBar = () => {
3544
return (
3645
<div id="jlab-gather-control-bar" className="jlab-gather-control-bar">
3746
<button className="jlab-gather-btn-control" onClick={toggleAudio}>
38-
{isLocalAudioEnabled ? 'Mute' : 'Unmute'}
47+
{isLocalAudioEnabled ? (
48+
<FontAwesomeIcon icon={faMicrophone} className="jlab-gather-icon" />
49+
) : (
50+
<FontAwesomeIcon
51+
icon={faMicrophoneSlash}
52+
className="jlab-gather-icon"
53+
/>
54+
)}
3955
</button>
4056

4157
<button className="jlab-gather-btn-control" onClick={toggleVideo}>
42-
{isLocalVideoEnabled ? 'Hide' : 'Unhide'}
58+
{isLocalVideoEnabled ? (
59+
<FontAwesomeIcon icon={faVideo} className="jlab-gather-icon" />
60+
) : (
61+
<FontAwesomeIcon icon={faVideoSlash} className="jlab-gather-icon" />
62+
)}
4363
</button>
4464

4565
{/* <ScreenShareButton /> */}
@@ -50,10 +70,13 @@ const ControlBar = () => {
5070
<SettingsButton />
5171

5272
<button
53-
className="jlab-gather-btn-common jlab-gather-btn-danger"
73+
className="jlab-gather-btn-control jlab-gather-btn-danger"
5474
onClick={handleLeave}
5575
>
56-
Leave Room
76+
<FontAwesomeIcon
77+
icon={faPersonThroughWindow}
78+
className="jlab-gather-icon"
79+
/>
5780
</button>
5881
</div>
5982
);

src/components/Icons.tsx

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,7 @@
11
import { LabIcon } from '@jupyterlab/ui-components';
2-
import React from 'react';
32
import arSvgStr from '../../icons/ar.svg';
43
import duckLogo from '../../icons/duckduck.svg';
54

6-
interface IIcons {
7-
className?: string;
8-
}
9-
10-
export const Icons = {
11-
raisedHand: ({ className }: IIcons) => (
12-
<svg
13-
className={className}
14-
xmlns="http://www.w3.org/2000/svg"
15-
viewBox="0 0 512 512"
16-
>
17-
<path d="M256 0c-25.3 0-47.2 14.7-57.6 36c-7-2.6-14.5-4-22.4-4c-35.3 0-64 28.7-64 64V261.5l-2.7-2.7c-25-25-65.5-25-90.5 0s-25 65.5 0 90.5L106.5 437c48 48 113.1 75 181 75H296h8c1.5 0 3-.1 4.5-.4c91.7-6.2 165-79.4 171.1-171.1c.3-1.5 .4-3 .4-4.5V160c0-35.3-28.7-64-64-64c-5.5 0-10.9 .7-16 2V96c0-35.3-28.7-64-64-64c-7.9 0-15.4 1.4-22.4 4C303.2 14.7 281.3 0 256 0zM240 96.1c0 0 0-.1 0-.1V64c0-8.8 7.2-16 16-16s16 7.2 16 16V95.9c0 0 0 .1 0 .1V232c0 13.3 10.7 24 24 24s24-10.7 24-24V96c0 0 0 0 0-.1c0-8.8 7.2-16 16-16s16 7.2 16 16v55.9c0 0 0 .1 0 .1v80c0 13.3 10.7 24 24 24s24-10.7 24-24V160.1c0 0 0-.1 0-.1c0-8.8 7.2-16 16-16s16 7.2 16 16V332.9c-.1 .6-.1 1.3-.2 1.9c-3.4 69.7-59.3 125.6-129 129c-.6 0-1.3 .1-1.9 .2H296h-8.5c-55.2 0-108.1-21.9-147.1-60.9L52.7 315.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L119 336.4c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V96c0-8.8 7.2-16 16-16c8.8 0 16 7.1 16 15.9V232c0 13.3 10.7 24 24 24s24-10.7 24-24V96.1z" />
18-
</svg>
19-
),
20-
spinner: ({ className }: IIcons) => (
21-
<svg
22-
className={className}
23-
xmlns="http://www.w3.org/2000/svg"
24-
viewBox="0 0 512 512"
25-
>
26-
<path d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z" />
27-
</svg>
28-
),
29-
forbidden: ({ className }: IIcons) => (
30-
<svg
31-
className={className}
32-
xmlns="http://www.w3.org/2000/svg"
33-
viewBox="0 0 16 16"
34-
>
35-
<path d="M8 .5A7.77 7.77 0 0 0 0 8a7.77 7.77 0 0 0 8 7.5A7.77 7.77 0 0 0 16 8 7.77 7.77 0 0 0 8 .5zM1.25 8A6 6 0 0 1 3 3.85L12.09 13A7.12 7.12 0 0 1 8 14.25 6.52 6.52 0 0 1 1.25 8zM13 12.15 3.91 3A7.12 7.12 0 0 1 8 1.75 6.52 6.52 0 0 1 14.75 8 6 6 0 0 1 13 12.15z" />
36-
</svg>
37-
),
38-
settings: ({ className }: IIcons) => (
39-
<svg
40-
className={className}
41-
xmlns="http://www.w3.org/2000/svg"
42-
viewBox="0 0 54 54"
43-
>
44-
<g>
45-
<path
46-
d="M51.22,21h-5.052c-0.812,0-1.481-0.447-1.792-1.197s-0.153-1.54,0.42-2.114l3.572-3.571
47-
c0.525-0.525,0.814-1.224,0.814-1.966c0-0.743-0.289-1.441-0.814-1.967l-4.553-4.553c-1.05-1.05-2.881-1.052-3.933,0l-3.571,3.571
48-
c-0.574,0.573-1.366,0.733-2.114,0.421C33.447,9.313,33,8.644,33,7.832V2.78C33,1.247,31.753,0,30.22,0H23.78
49-
C22.247,0,21,1.247,21,2.78v5.052c0,0.812-0.447,1.481-1.197,1.792c-0.748,0.313-1.54,0.152-2.114-0.421l-3.571-3.571
50-
c-1.052-1.052-2.883-1.05-3.933,0l-4.553,4.553c-0.525,0.525-0.814,1.224-0.814,1.967c0,0.742,0.289,1.44,0.814,1.966l3.572,3.571
51-
c0.573,0.574,0.73,1.364,0.42,2.114S8.644,21,7.832,21H2.78C1.247,21,0,22.247,0,23.78v6.439C0,31.753,1.247,33,2.78,33h5.052
52-
c0.812,0,1.481,0.447,1.792,1.197s0.153,1.54-0.42,2.114l-3.572,3.571c-0.525,0.525-0.814,1.224-0.814,1.966
53-
c0,0.743,0.289,1.441,0.814,1.967l4.553,4.553c1.051,1.051,2.881,1.053,3.933,0l3.571-3.572c0.574-0.573,1.363-0.731,2.114-0.42
54-
c0.75,0.311,1.197,0.98,1.197,1.792v5.052c0,1.533,1.247,2.78,2.78,2.78h6.439c1.533,0,2.78-1.247,2.78-2.78v-5.052
55-
c0-0.812,0.447-1.481,1.197-1.792c0.751-0.312,1.54-0.153,2.114,0.42l3.571,3.572c1.052,1.052,2.883,1.05,3.933,0l4.553-4.553
56-
c0.525-0.525,0.814-1.224,0.814-1.967c0-0.742-0.289-1.44-0.814-1.966l-3.572-3.571c-0.573-0.574-0.73-1.364-0.42-2.114
57-
S45.356,33,46.168,33h5.052c1.533,0,2.78-1.247,2.78-2.78V23.78C54,22.247,52.753,21,51.22,21z M52,30.22
58-
C52,30.65,51.65,31,51.22,31h-5.052c-1.624,0-3.019,0.932-3.64,2.432c-0.622,1.5-0.295,3.146,0.854,4.294l3.572,3.571
59-
c0.305,0.305,0.305,0.8,0,1.104l-4.553,4.553c-0.304,0.304-0.799,0.306-1.104,0l-3.571-3.572c-1.149-1.149-2.794-1.474-4.294-0.854
60-
c-1.5,0.621-2.432,2.016-2.432,3.64v5.052C31,51.65,30.65,52,30.22,52H23.78C23.35,52,23,51.65,23,51.22v-5.052
61-
c0-1.624-0.932-3.019-2.432-3.64c-0.503-0.209-1.021-0.311-1.533-0.311c-1.014,0-1.997,0.4-2.761,1.164l-3.571,3.572
62-
c-0.306,0.306-0.801,0.304-1.104,0l-4.553-4.553c-0.305-0.305-0.305-0.8,0-1.104l3.572-3.571c1.148-1.148,1.476-2.794,0.854-4.294
63-
C10.851,31.932,9.456,31,7.832,31H2.78C2.35,31,2,30.65,2,30.22V23.78C2,23.35,2.35,23,2.78,23h5.052
64-
c1.624,0,3.019-0.932,3.64-2.432c0.622-1.5,0.295-3.146-0.854-4.294l-3.572-3.571c-0.305-0.305-0.305-0.8,0-1.104l4.553-4.553
65-
c0.304-0.305,0.799-0.305,1.104,0l3.571,3.571c1.147,1.147,2.792,1.476,4.294,0.854C22.068,10.851,23,9.456,23,7.832V2.78
66-
C23,2.35,23.35,2,23.78,2h6.439C30.65,2,31,2.35,31,2.78v5.052c0,1.624,0.932,3.019,2.432,3.64
67-
c1.502,0.622,3.146,0.294,4.294-0.854l3.571-3.571c0.306-0.305,0.801-0.305,1.104,0l4.553,4.553c0.305,0.305,0.305,0.8,0,1.104
68-
l-3.572,3.571c-1.148,1.148-1.476,2.794-0.854,4.294c0.621,1.5,2.016,2.432,3.64,2.432h5.052C51.65,23,52,23.35,52,23.78V30.22z"
69-
/>
70-
<path
71-
d="M27,18c-4.963,0-9,4.037-9,9s4.037,9,9,9s9-4.037,9-9S31.963,18,27,18z M27,34c-3.859,0-7-3.141-7-7s3.141-7,7-7
72-
s7,3.141,7,7S30.859,34,27,34z"
73-
/>
74-
</g>
75-
</svg>
76-
)
77-
};
78-
795
export const LogoIcon = new LabIcon({
806
name: 'jupyterlab-gather:icon_logo',
817
svgstr: duckLogo

src/components/Peer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import {
44
useHMSStore,
55
useVideo
66
} from '@100mslive/react-sdk';
7+
import { faHand } from '@fortawesome/free-solid-svg-icons';
8+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
79
import React from 'react';
810
import Avatar from './Avatar';
9-
import { Icons } from './Icons';
1011

1112
interface IPeer {
1213
peer: HMSPeer;
@@ -30,7 +31,10 @@ const Peer = ({ peer, className }: IPeer) => {
3031
return (
3132
<div className={`jlab-gather-peer-tile jlab-gather-peer-tile-${className}`}>
3233
{peer.isHandRaised ? (
33-
<Icons.raisedHand className="jlab-gather-peer-hand-raised-icon" />
34+
<FontAwesomeIcon
35+
icon={faHand}
36+
className="jlab-gather-peer-hand-raised-icon"
37+
/>
3438
) : (
3539
''
3640
)}

src/components/buttons/PluginButton.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import {
88
useHMSActions,
99
useHMSStore
1010
} from '@100mslive/react-sdk';
11+
import { faBan, faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
12+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1113
import React, { useEffect, useState } from 'react';
1214
import ArCubePlugin from '../../arCubePlugin';
13-
import { Icons } from '../Icons';
1415

1516
const PluginButton = () => {
1617
const hmsActions = useHMSActions();
@@ -76,11 +77,11 @@ const PluginButton = () => {
7677
disabled={isDisabled}
7778
>
7879
{isDisabled ? (
79-
<Icons.forbidden className="icon" />
80+
<FontAwesomeIcon icon={faBan} className="jlab-gather-icon" />
8081
) : !isPresenting && !isPluginLoaded ? (
81-
'Start AR'
82+
<FontAwesomeIcon icon={faEye} className="jlab-gather-icon" />
8283
) : (
83-
'Stop AR'
84+
<FontAwesomeIcon icon={faEyeSlash} className="jlab-gather-icon" />
8485
)}
8586
</button>
8687
);

src/components/buttons/RaiseHandButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import {
44
useHMSActions,
55
useHMSStore
66
} from '@100mslive/react-sdk';
7+
import { faHand } from '@fortawesome/free-solid-svg-icons';
8+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
79
import React, { useCallback } from 'react';
8-
import { Icons } from '../Icons';
910

1011
const RaiseHandButton = () => {
1112
const localPeerId = useHMSStore(selectLocalPeerID);
@@ -22,7 +23,8 @@ const RaiseHandButton = () => {
2223

2324
return (
2425
<button className="jlab-gather-btn-control" onClick={toggleRaiseHand}>
25-
<Icons.raisedHand
26+
<FontAwesomeIcon
27+
icon={faHand}
2628
className={`jlab-gather-icon ${isHandRaised ? 'jlab-gather-icon-breathe' : ''}`}
2729
/>
2830
</button>

src/components/buttons/SettingsButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { faGear } from '@fortawesome/free-solid-svg-icons';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13
import React, { useState } from 'react';
2-
import { Icons } from '../Icons';
34
import DeviceSettingModal from '../modals/DeviceSettingModal';
45

56
const SettingsButton = () => {
@@ -19,7 +20,7 @@ const SettingsButton = () => {
1920
className="jlab-gather-btn-control"
2021
onClick={handleOpenDeviceSettingsModal}
2122
>
22-
<Icons.settings className="jlab-gather-icon" />
23+
<FontAwesomeIcon icon={faGear} className="jlab-gather-icon" />
2324
</button>
2425
<DeviceSettingModal
2526
isOpen={isDeviceSettingsModalOpen}

src/layouts/PreviewView.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
useHMSActions,
55
useHMSStore
66
} from '@100mslive/react-sdk';
7+
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
8+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
79
import React, { useState } from 'react';
8-
import { Icons } from '../components/Icons';
910
import Video from '../components/Video';
1011
import SettingsButton from '../components/buttons/SettingsButton';
11-
1212
const PreviewView = () => {
1313
console.log('preview');
1414
const hmsActions = useHMSActions();
@@ -38,7 +38,10 @@ const PreviewView = () => {
3838
trackId={localPeer.videoTrack}
3939
/>
4040
) : (
41-
<Icons.spinner className="jlab-gather-spinner large" />
41+
<FontAwesomeIcon
42+
icon={faSpinner}
43+
className="jlab-gather-spinner large"
44+
/>
4245
)}
4346
<div className="jlab-gather-control-bar">
4447
<button
@@ -47,7 +50,10 @@ const PreviewView = () => {
4750
// disabled={!enableJoin}
4851
>
4952
{isJoining ? (
50-
<Icons.spinner className="jlab-gather-spinner large" />
53+
<FontAwesomeIcon
54+
icon={faSpinner}
55+
className="jlab-gather-spinner large"
56+
/>
5157
) : (
5258
'Join'
5359
)}

0 commit comments

Comments
 (0)