Skip to content

Commit

Permalink
fixes document null error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe-Codes committed Dec 6, 2020
1 parent 2ccb9ee commit 9c45b7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/gabrielrussell/code/world-weather-app/src/reportWebVitals.js":"1","/Users/gabrielrussell/code/world-weather-app/src/App.js":"2","/Users/gabrielrussell/code/world-weather-app/src/index.js":"3","/Users/gabrielrussell/code/world-weather-app/src/timezones.js":"4","/Users/gabrielrussell/code/world-weather-app/src/components/InfoModal/InfoModal.js":"5"},{"size":362,"mtime":1606235130117,"results":"6","hashOfConfig":"7"},{"size":11042,"mtime":1607229487225,"results":"8","hashOfConfig":"7"},{"size":500,"mtime":1606235130116,"results":"9","hashOfConfig":"7"},{"size":650,"mtime":1606693764967,"results":"10","hashOfConfig":"7"},{"size":2188,"mtime":1607228767370,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"139zll3",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"19"},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"19"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/gabrielrussell/code/world-weather-app/src/reportWebVitals.js",[],["24","25"],"/Users/gabrielrussell/code/world-weather-app/src/App.js",[],"/Users/gabrielrussell/code/world-weather-app/src/index.js",[],["26","27"],"/Users/gabrielrussell/code/world-weather-app/src/timezones.js",[],"/Users/gabrielrussell/code/world-weather-app/src/components/InfoModal/InfoModal.js",[],{"ruleId":"28","replacedBy":"29"},{"ruleId":"30","replacedBy":"31"},{"ruleId":"28","replacedBy":"32"},{"ruleId":"30","replacedBy":"33"},"no-native-reassign",["34"],"no-negated-in-lhs",["35"],["34"],["35"],"no-global-assign","no-unsafe-negation"]
[{"/Users/gabrielrussell/code/world-weather-app/src/reportWebVitals.js":"1","/Users/gabrielrussell/code/world-weather-app/src/App.js":"2","/Users/gabrielrussell/code/world-weather-app/src/index.js":"3","/Users/gabrielrussell/code/world-weather-app/src/timezones.js":"4"},{"size":362,"mtime":1606235130117,"results":"5","hashOfConfig":"6"},{"size":11067,"mtime":1607229914648,"results":"7","hashOfConfig":"6"},{"size":500,"mtime":1606235130116,"results":"8","hashOfConfig":"6"},{"size":650,"mtime":1606693764967,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"139zll3",{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"17"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"17"},"/Users/gabrielrussell/code/world-weather-app/src/reportWebVitals.js",[],["20","21"],"/Users/gabrielrussell/code/world-weather-app/src/App.js",[],"/Users/gabrielrussell/code/world-weather-app/src/index.js",[],["22","23"],"/Users/gabrielrussell/code/world-weather-app/src/timezones.js",[],{"ruleId":"24","replacedBy":"25"},{"ruleId":"26","replacedBy":"27"},{"ruleId":"24","replacedBy":"28"},{"ruleId":"26","replacedBy":"29"},"no-native-reassign",["30"],"no-negated-in-lhs",["31"],["30"],["31"],"no-global-assign","no-unsafe-negation"]
25 changes: 15 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,21 @@ export default class App extends Component {

// on update adjusts temp and favorite info location to be responsive
componentDidUpdate() {
document.getElementById('info-met').style.left = `calc(50% - ${
this.tempSize() * 0.75
}px)`;

document.getElementById('info-fav').style.right = `calc(50% - ${
this.getTextWidth(
this.state.weather.name + '' + this.state.weather.sys.country + ' ',
'500 32pt montseratt'
) * 0.7
}px)`;
if (typeof this.state.weather.main != 'undefined') {
document.getElementById('info-met').style.left = `calc(50% - ${
this.tempSize() * 0.75
}px)`;

document.getElementById('info-fav').style.right = `calc(50% - ${
this.getTextWidth(
this.state.weather.name +
'' +
this.state.weather.sys.country +
' ',
'500 32pt montseratt'
) * 0.7
}px)`;
}
}

// changes the informative text and borders to show when the info icon is pressed
Expand Down

0 comments on commit 9c45b7a

Please sign in to comment.