Skip to content

Commit 850373e

Browse files
committed
Renamed Flags.css and added custom styling Toasts
1 parent 2ce5f51 commit 850373e

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

src/app/components/SocketHandler.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { SOCKET_BASE_URL } from 'app/../config/config';
2+
import 'app/styles/ReactToastNotifications.css';
23
import * as SocketHandlerInterfaces from 'app/types/SocketHandler';
34
import * as React from 'react';
45
import { useToasts } from 'react-toast-notifications';
@@ -24,75 +25,75 @@ export const SocketHandler = (props: SocketHandlerInterfaces.Props) => {
2425
} = props;
2526

2627
socket.on('Info', (message: string) => {
27-
addToast(message, { appearance: 'info', autoDismiss: true });
28+
addToast(message, { appearance: 'info', autoDismiss: false });
2829
});
2930

3031
socket.on('Success', (message: string) => {
31-
addToast(message, { appearance: 'success', autoDismiss: true });
32+
addToast(message, { appearance: 'success', autoDismiss: false });
3233
});
3334

3435
socket.on('Error', (message: string) => {
35-
addToast(message, { appearance: 'error', autoDismiss: true });
36+
addToast(message, { appearance: 'error', autoDismiss: false });
3637
});
3738

3839
socket.on('connect', () => {
39-
addToast('Connected to Server!', { appearance: 'success', autoDismiss: true });
40+
addToast('Connected to Server!', { appearance: 'success', autoDismiss: false });
4041
});
4142

4243
socket.on('Compile Info', (message: string) => {
43-
addToast(message, { appearance: 'info', autoDismiss: true });
44+
addToast(message, { appearance: 'info', autoDismiss: false });
4445
});
4546

4647
socket.on('Compile Success', () => {
47-
addToast('Compiled Successfully!', { appearance: 'success', autoDismiss: true });
48+
addToast('Compiled Successfully!', { appearance: 'success', autoDismiss: false });
4849
sendCompileSuccess();
4950
});
5051

5152
socket.on('Compile Error', (message: string) => {
52-
addToast(`Compile Error: ${message}`, { appearance: 'error', autoDismiss: true }),
53+
addToast(`Compile Error: ${message}`, { appearance: 'error', autoDismiss: false }),
5354
sendCompileError('');
5455
});
5556

5657
socket.on('Compile Error Log', (log: string) => {
57-
addToast('Compile Error', { appearance: 'error', autoDismiss: true }), sendCompileError(log);
58+
addToast('Compile Error', { appearance: 'error', autoDismiss: false }), sendCompileError(log);
5859
});
5960

6061
socket.on('Match Info', (message: string) => {
61-
addToast(message, { appearance: 'info', autoDismiss: true });
62+
addToast(message, { appearance: 'info', autoDismiss: false });
6263
});
6364

6465
socket.on('Match Error', (message: string) => {
65-
addToast(message, { appearance: 'error', autoDismiss: true }), sendExecuteError(message);
66+
addToast(message, { appearance: 'error', autoDismiss: false }), sendExecuteError(message);
6667
});
6768

6869
socket.on('Match Result Success', (result: string) => {
69-
addToast(result, { appearance: 'success', autoDismiss: true });
70+
addToast(result, { appearance: 'success', autoDismiss: false });
7071
});
7172

7273
socket.on('Match Result Error', (result: string) => {
73-
addToast(result, { appearance: 'error', autoDismiss: true });
74+
addToast(result, { appearance: 'error', autoDismiss: false });
7475
});
7576

7677
socket.on('Match Success', (matchLogs: string) => {
77-
addToast('Match Executed Successfully!', { appearance: 'success', autoDismiss: true });
78+
addToast('Match Executed Successfully!', { appearance: 'success', autoDismiss: false });
7879
sendExecuteSuccess(matchLogs);
7980
});
8081

8182
socket.on('Debug Run Info', (message: string) => {
82-
addToast(message, { appearance: 'info', autoDismiss: true });
83+
addToast(message, { appearance: 'info', autoDismiss: false });
8384
});
8485

8586
socket.on('Debug Run Success', (stackTrace: string) => {
8687
sendDebugRunSuccess(stackTrace);
8788
});
8889

8990
socket.on('Debug Run Error', (message: string) => {
90-
addToast(`Debug Run Error: ${message}`, { appearance: 'error', autoDismiss: true }),
91+
addToast(`Debug Run Error: ${message}`, { appearance: 'error', autoDismiss: false }),
9192
sendDebugRunError();
9293
});
9394

9495
socket.on('disconnect', () => {
95-
addToast('Disconnected', { appearance: 'error', autoDismiss: true });
96+
addToast('Disconnected', { appearance: 'error', autoDismiss: false });
9697
});
9798

9899
return () => {

src/app/components/UserProfileModal/EditProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as styles1 from 'app/styles/Authentication.module.css';
2-
import 'app/styles/Flags.css';
2+
import 'app/styles/ReactFlagsSelect.css';
33
import * as styles from 'app/styles/UserProfileModal.module.css';
44
import { Avatar } from 'app/types/Authentication/Register';
55
import { InputName } from 'app/types/UserProfileModal';

src/app/styles/Flags.css renamed to src/app/styles/ReactFlagsSelect.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* Overriding react-flag-select package styles */
12
.flag-select {
23
align-items: center !important;
34
width: 100% !important;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Overriding the react-toast-notifications package-styles */
2+
.react-toast-notifications__container {
3+
overflow: hidden !important;
4+
}

0 commit comments

Comments
 (0)