@@ -7,15 +7,14 @@ import {
77} from "react" ;
88
99import {
10- StyledButton ,
11- StyledButtonContent ,
1210 StyledButtons ,
1311 StyledCalc ,
1412 StyledInputOutput ,
1513 StyledInputOutputContents ,
1614} from "./styles" ;
1715import { BorderedAppContentHandles } from "../../components/BorderedApp/BorderedApp" ;
1816import useSystemSettings from "../../stores/systemSettingsStore" ;
17+ import CommonButton from "../../components/Button" ;
1918
2019export type CalculatorHandles = BorderedAppContentHandles < HTMLDivElement > ;
2120
@@ -29,7 +28,13 @@ const Calculator = forwardRef<CalculatorHandles, CalculatorProps>(
2928 const elementRef = useRef < HTMLDivElement > ( null ) ;
3029 const [ input , setInput ] = useState < string > ( "" ) ;
3130 const [ output , setOutput ] = useState < string > ( "" ) ;
32- const [ scrollbarColor ] = useSystemSettings ( ( s ) => [ s . iconColor ] ) ;
31+ const [ scrollbarColor , buttonColor , fontColor , primaryButtonColor ] =
32+ useSystemSettings ( ( s ) => [
33+ s . iconColor ,
34+ s . secondaryColor ,
35+ s . fontColor ,
36+ s . primaryColor ,
37+ ] ) ;
3338 const appendToInput = ( value : string ) =>
3439 setInput ( ( current ) => current + value ) ;
3540 const removeFromEnd = ( count : number = 1 ) =>
@@ -117,9 +122,18 @@ const Calculator = forwardRef<CalculatorHandles, CalculatorProps>(
117122 }
118123
119124 return (
120- < StyledButton onClick = { handleClick } >
121- < StyledButtonContent > { displayChar } </ StyledButtonContent >
122- </ StyledButton >
125+ < CommonButton
126+ onClick = { handleClick }
127+ width = { "100%" }
128+ height = { "100%" }
129+ borderRadius = { 12 }
130+ backgroundColor = {
131+ displayChar === "=" ? primaryButtonColor : buttonColor
132+ }
133+ color = { fontColor }
134+ >
135+ { displayChar }
136+ </ CommonButton >
123137 ) ;
124138 }
125139
0 commit comments