11import { BiEditAlt } from "react-icons/bi" ;
22import { HiOutlineTrash } from "react-icons/hi" ;
3-
43import styled from "styled-components" ;
54import {
65 convertToPersian ,
76 getFieldTranslationByNames ,
87} from "../../../services/Utility" ;
98import Result from "../../../components/Result" ;
10-
9+ import { useTheme } from "../../../services/reducers/ThemeContext" ;
1110const Wrapper = styled . div `
1211 border-radius: 5px;
1312 background-color: ${ ( props ) =>
@@ -54,6 +53,8 @@ const ActionWrapper = styled.div`
5453
5554const ResultWrapper = styled . div `
5655 display: flex;
56+ color: ${ ( props ) => props . theme . colors . newColors . shades . title } ;
57+
5758 flex-direction: column;
5859 align-items: flex-start;
5960 gap: 5px;
@@ -62,24 +63,21 @@ const ResultWrapper = styled.div`
6263 }
6364` ;
6465
65- const Title = styled . h3 `
66- color: ${ ( props ) => props . theme . colors . newColors . shades . title } ;
67- font-size: 14px;
68- font-weight: 500;
69- ` ;
70-
7166const Value = styled . p `
7267 color: ${ ( props ) => props . theme . colors . newColors . shades . title } ;
7368 font-size: 16px;
7469 font-weight: 400;
7570` ;
7671
7772const ResultInfo = ( { setAssign, rial, psc, setPsc, setRial } ) => {
73+ const { theme } = useTheme ( ) ;
74+ console . log ( "theme" , theme ) ;
7875 const deleteHandler = ( ) => {
7976 setPsc ( "" ) ;
8077 setRial ( "" ) ;
8178 setAssign ( false ) ;
8279 } ;
80+ const buttonColer = theme == "light" ? "black" : "white" ;
8381 return (
8482 < Wrapper >
8583 < Results >
@@ -103,17 +101,14 @@ const ResultInfo = ({ setAssign, rial, psc, setPsc, setRial }) => {
103101 { convertToPersian ( rial ) } IRR / { convertToPersian ( psc ) } PSC
104102 </ Value >
105103 </ ResultWrapper >
106- < Result
107- title = { getFieldTranslationByNames ( "523" ) }
108- value = { "5%" }
109- />
104+ < Result title = { getFieldTranslationByNames ( "523" ) } value = { "5%" } />
110105 </ Results >
111106 < Actions >
112107 < ActionWrapper onClick = { ( ) => setAssign ( false ) } >
113- < BiEditAlt size = { 20 } />
108+ < BiEditAlt size = { 20 } color = { buttonColer } />
114109 </ ActionWrapper >
115110 < ActionWrapper onClick = { deleteHandler } >
116- < HiOutlineTrash size = { 20 } />
111+ < HiOutlineTrash size = { 20 } color = "#9b0e0e" />
117112 </ ActionWrapper >
118113 </ Actions >
119114 </ Wrapper >
0 commit comments