Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

typo: dichargeTime -> dischargeTime #32

Merged
merged 1 commit into from
Aug 19, 2019
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
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