Skip to content

Commit

Permalink
honor disabled prop value
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHalwax committed Nov 30, 2023
1 parent c6cd737 commit 8828caf
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/properties/ActivityProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ActivityProperties = props =>
<AdditionalInformation {...props}/>
<EvaluationRating {...props}/>
<Status {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>

export default ActivityProperties
2 changes: 1 addition & 1 deletion src/renderer/components/properties/BoundariesProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default props => {
<StaffComments {...props}/>
<AdditionalInformation {...props}/>
<Status {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>
)
}
2 changes: 1 addition & 1 deletion src/renderer/components/properties/EquipmentProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EquipmentProperties = props =>
<EvaluationRating {...props}/>
<Status {...props}/>
<Condition {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>

export default EquipmentProperties
2 changes: 1 addition & 1 deletion src/renderer/components/properties/GraphicsProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default props => {
<StaffComments {...props}/>
<AdditionalInformation {...props}/>
<Status {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const InstallationProperties = props =>
<AdditionalInformation {...props}/>
<EvaluationRating {...props}/>
<Status {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>

export default InstallationProperties
7 changes: 4 additions & 3 deletions src/renderer/components/properties/KProperty.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/* eslint-disable react/prop-types */
import React from 'react'
import ColSpan2 from './ColSpan2'
import { useServices } from '../hooks'

const KProperty = () => {
const KProperty = (props) => {
const { emitter } = useServices()

const toggleKBar = (e) => {
const toggleKBar = () => {
emitter.emit('KBAR/TOGGLE')
}

return (
<ColSpan2>
<button className='properties__button' style={{ width: '100%' }} onClick={toggleKBar}>Show more actions ...</button>
<button className='properties__button' style={{ width: '100%' }} onClick={toggleKBar} disabled={props.disabled} >Show more actions ...</button>
</ColSpan2>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/properties/PointProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PointProperties = props =>
<StaffComments {...props}/>
<AdditionalInformation {...props}/>
<Status {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>

export default PointProperties
5 changes: 5 additions & 0 deletions src/renderer/components/properties/Properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@

.properties__button:hover {
background-color: rgb(11, 65, 100)
}

.properties__button:disabled {
opacity: 0.5;
background-color: rgb(1, 119, 169)
}
2 changes: 1 addition & 1 deletion src/renderer/components/properties/UnitProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const UnitProperties = props => {
<Condition {...props}/>
<Reinforcement {...props}/>
<UnitModifiers {...props}/>
<KProperty />
<KProperty {...props}/>
</GridCols2>
)
}
Expand Down

0 comments on commit 8828caf

Please sign in to comment.