Skip to content

Commit

Permalink
Merge pull request #32 from kuldeepkeshwar/master
Browse files Browse the repository at this point in the history
typo: dichargeTime -> dischargeTime
  • Loading branch information
addyosmani authored Aug 19, 2019
2 parents 37a1dfb + b5bb3be commit 2085570
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BatteryUI extends Component {
state = {
chargingTime: null,
chargingState: null,
dichargeTime: null,
dischargeTime: null,
level: null,
unsupportMessage: null
};
Expand All @@ -49,14 +49,14 @@ class BatteryUI extends Component {
updateBatteryUI = battery => {
this.setState({
chargingTime: `${battery.chargingTime} Seconds`,
dichargeTime: `${battery.dischargingTime} Seconds`,
dischargeTime: `${battery.dischargingTime} Seconds`,
level: `${battery.level * 100}%`,
chargingState: battery.charging === true ? 'Charging' : 'Discharging'
});
};

render () {
const { chargingTime, chargingState, dichargeTime, level, unsupportMessage } = this.state;
const { chargingTime, chargingState, dischargeTime, level, unsupportMessage } = this.state;
return (
<div className='list'>
{ unsupportMessage ? (
Expand All @@ -73,7 +73,7 @@ class BatteryUI extends Component {
</div>
<div className='list-item'>
<div>Time to discharge:</div>
<div>{dichargeTime}</div>
<div>{dischargeTime}</div>
</div>
<div className='list-item'>
<div>Battery Level:</div>
Expand Down
2 changes: 1 addition & 1 deletion cra-battery-considerate-loading/src/utils/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const useBatteryStatus = () => {
const updateBatteryStatus = battery => {
setBatteryStatus({
chargingTime: `${battery.chargingTime} Seconds`,
dichargeTime: `${battery.dischargingTime} Seconds`,
dischargeTime: `${battery.dischargingTime} Seconds`,
level: battery.level,
chargingState: battery.charging === true ? 'Charging' : 'Discharging'
});
Expand Down
8 changes: 4 additions & 4 deletions hooks/battery/battery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('useBatteryStatus', () => {

expect(result.current.batteryStatus).toEqual({
chargingTime: '20 Seconds',
dichargeTime: '40 Seconds',
dischargeTime: '40 Seconds',
level: 50,
chargingState: 'Charging'
});
Expand All @@ -63,7 +63,7 @@ describe('useBatteryStatus', () => {

expect(result.current.batteryStatus).toEqual({
chargingTime: '20 Seconds',
dichargeTime: '40 Seconds',
dischargeTime: '40 Seconds',
level: 50,
chargingState: 'Charging'
});
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('useBatteryStatus', () => {
// batteryStatus is supposed to be updated because updateBatteryStatus should be called internally
expect(result.current.batteryStatus).toEqual({
chargingTime: '20 Seconds',
dichargeTime: '40 Seconds',
dischargeTime: '40 Seconds',
level: 50,
chargingState: 'Charging'
});
Expand All @@ -119,7 +119,7 @@ describe('useBatteryStatus', () => {

expect(result.current.batteryStatus).toEqual({
chargingTime: '30 Seconds',
dichargeTime: '50 Seconds',
dischargeTime: '50 Seconds',
level: 60,
chargingState: 'Discharging'
});
Expand Down
2 changes: 1 addition & 1 deletion hooks/battery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const useBatteryStatus = () => {
const updateBatteryStatus = battery => {
setBatteryStatus({
chargingTime: `${battery.chargingTime} Seconds`,
dichargeTime: `${battery.dischargingTime} Seconds`,
dischargeTime: `${battery.dischargingTime} Seconds`,
level: battery.level,
chargingState: battery.charging === true ? 'Charging' : 'Discharging'
});
Expand Down

0 comments on commit 2085570

Please sign in to comment.