Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ui/widgets/LED/led.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.Led {
width: 16px;
height: 16px;
width: 11px;
height: 11px;
border-radius: 50%;
background-color: #00ee00;
}
Expand Down
7 changes: 5 additions & 2 deletions src/ui/widgets/LED/led.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ describe("width property is used", (): void => {
test("width changes the size of the LED", (): void => {
const renderedLed = renderLed({ width: 10 });

expect(renderedLed.props.style.width).toBe("10px");
expect(renderedLed.props.style.height).toBe("10px");
// Width in CS-Studio doesn't quite match width in the browser,
// so whatever is input has 5 subtracted from it, this makes it
// look more like CS-Studio
expect(renderedLed.props.style.width).toBe("5px");
expect(renderedLed.props.style.height).toBe("5px");
});
});
6 changes: 4 additions & 2 deletions src/ui/widgets/LED/led.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export const LedComponent = (props: LedComponentProps): JSX.Element => {
const style: any = {};

if (width) {
style.width = `${width}px`;
style.height = `${width}px`;
// make sizes similar to size in CS-Studio, five taken
// away from default in css file too
style.width = `${width - 5}px`;
style.height = `${width - 5}px`;
}

let allClasses = classes.Led;
Expand Down