Skip to content
Prev Previous commit
Next Next commit
Offline mode: expose UI/option in Settings panel
  • Loading branch information
addyosmani committed May 9, 2016
commit 82ddd1dd24e3c3e4c7601060ebba7c28b6044ecb
6 changes: 6 additions & 0 deletions src/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ var Settings = React.createClass({
</label>
<p>Show "reply" links to Hacker News</p>
</div>
<div className="Settings__setting Settings__setting--checkbox">
<label htmlFor="offlineMode">
<input type="checkbox" name="offlineMode" id="offlineMode" checked={SettingsStore.offlineMode}/> Offline Mode
</label>
<p>Show items flagged as dead.</p>
</div>
<div className="Settings__setting Settings__setting--checkbox">
<label htmlFor="showDead">
<input type="checkbox" name="showDead" id="showDead" checked={SettingsStore.showDead}/> show dead
Expand Down
4 changes: 3 additions & 1 deletion src/stores/SettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var SettingsStore = {
showDeleted: false,
titleFontSize: 18,
listSpacing: 16,
offlineMode: false,

load() {
var json = storage.get(STORAGE_KEY)
Expand All @@ -25,7 +26,8 @@ var SettingsStore = {
showDead: this.showDead,
showDeleted: this.showDeleted,
titleFontSize: this.titleFontSize,
listSpacing: this.listSpacing
listSpacing: this.listSpacing,
offlineMode: this.offlineMode
}))
}
}
Expand Down