Skip to content

Commit 61d33c5

Browse files
committed
feat(roundtime): format RT and CT squares top/bottom instead of left/right
1 parent 9596210 commit 61d33c5

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

electron/renderer/components/game/game-roundtime.tsx

+15-6
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ const GameTimeDisplay: React.FC<GameTimeDisplayProps> = (
2929
return (
3030
<div
3131
style={{
32-
display: 'inline-block',
32+
position: 'relative',
3333
width: '30px',
3434
height: '25px',
35-
position: 'relative',
3635
margin: 0,
3736
padding: 0,
3837
border: '1px solid',
3938
borderRadius: '5px',
40-
borderColor: fillColor,
39+
borderColor: euiTheme.border.color,
4140
}}
4241
>
4342
<div
@@ -86,10 +85,14 @@ export const GameRoundTime: React.FC<GameRoundTimeProps> = (
8685
// Example: '1737941270'.
8786
const serverTimeRef = useRef<number>(0); // current time on game server
8887
const roundTimeRef = useRef<number>(0); // future time when can take action
89-
const castTimeRef = useRef<number>(0); // future time when spell prepared
88+
const castTimeRef = useRef<number>(0); // future time when spell is prepared
9089

9190
// User-friendly remaining durations (in seconds).
9291
// Example: '6' (for 6 seconds remaining).
92+
// The 'current' values are decremented every second.
93+
// It's how many seconds are left until the action can be taken.
94+
// The 'initial' values are how many seconds to wait in total.
95+
// Together, they allow us to proportionally style the progress bars.
9396
const [currentRT, setCurrentRT] = useState<number>(0);
9497
const [initialRT, setInitialRT] = useState<number>(0);
9598
const [currentCT, setCurrentCT] = useState<number>(0);
@@ -138,7 +141,13 @@ export const GameRoundTime: React.FC<GameRoundTimeProps> = (
138141
});
139142

140143
return (
141-
<>
144+
<div
145+
style={{
146+
display: 'flex',
147+
flexDirection: 'column',
148+
gap: '5px',
149+
}}
150+
>
142151
<GameTimeDisplay
143152
type="RoundTime"
144153
currentTime={currentRT}
@@ -153,7 +162,7 @@ export const GameRoundTime: React.FC<GameRoundTimeProps> = (
153162
textColor={euiTheme.colors.fullShade}
154163
fillColor={euiTheme.colors.primary}
155164
/>
156-
</>
165+
</div>
157166
);
158167
};
159168

0 commit comments

Comments
 (0)