Skip to content

Commit 3eb8ae0

Browse files
committed
feat(game-stream-text): make text style optional
1 parent dc389a6 commit 3eb8ae0

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

electron/renderer/components/game/game-stream-text.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ export const GameStreamText: React.FC<GameStreamTextProps> = memo(
2626
let fontWeight = euiTheme.font.weight.regular;
2727
let fontColor = euiTheme.colors.text;
2828

29-
if (logLine.styles.outputClass === 'mono') {
29+
if (logLine.styles?.outputClass === 'mono') {
3030
fontFamily = euiTheme.font.familyCode;
3131
fontSize = euiTheme.size.m;
3232
}
3333

34-
if (logLine.styles.stylePreset === 'roomName') {
34+
if (logLine.styles?.stylePreset === 'roomName') {
3535
fontColor = euiTheme.colors.title;
3636
fontWeight = euiTheme.font.weight.bold;
3737
}
3838

39-
if (logLine.styles.bold === true) {
39+
if (logLine.styles?.bold === true) {
4040
fontWeight = euiTheme.font.weight.bold;
4141
}
4242

43-
if (logLine.styles.subdued === true) {
43+
if (logLine.styles?.subdued === true) {
4444
fontColor = euiTheme.colors.subduedText;
4545
}
4646

electron/renderer/components/game/game.utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { css } from '@emotion/react';
21
import * as rxjs from 'rxjs';
32
import type { GameLogLine } from '../../types/game.types.jsx';
43

@@ -9,7 +8,6 @@ const emptyLogLine: GameLogLine = {
98
eventId: '',
109
streamId: '',
1110
text: '',
12-
styles: css(),
1311
};
1412

1513
/**

electron/renderer/types/game.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface GameLogLine {
2929
/**
3030
* The text formatting to apply to the entire line.
3131
*/
32-
styles: {
32+
styles?: {
3333
/**
3434
* The theme color mode to use (e.g. 'light' or 'dark').
3535
*/

0 commit comments

Comments
 (0)