forked from nsand/tab-glutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Yury Shapkarin
committed
Jan 28, 2020
1 parent
c1bedd9
commit 69e07bc
Showing
6 changed files
with
124 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React from 'react'; | ||
|
||
import themes from '../../themes'; | ||
|
||
export default class Options extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
showUrl: window.localStorage.showURL, | ||
isSeparated: window.localStorage.getItem('isSeparated'), | ||
isCollapsed: window.localStorage.getItem('isCollapsed') || 'true', | ||
theme: window.localStorage.getItem('theme') || 'light' | ||
}; | ||
} | ||
changeTheme(event) { | ||
this.setState({theme: event.target.value}); | ||
window.localStorage.setItem('theme', event.target.value); | ||
} | ||
componentDidMount() {} | ||
render() { | ||
return ( | ||
<div> | ||
<nav className="navigation"> | ||
<img src="../img/tab_glutton_48.png" className="brand" /> | ||
<h1>Tab Glutton</h1> | ||
</nav> | ||
<main className="main"> | ||
<section> | ||
<header className="heading"> | ||
<h2 className="headingText">Display</h2> | ||
</header> | ||
<ul className="options"> | ||
<li> | ||
<div> | ||
<input type="checkbox" id="showURL" /> | ||
<label className="label" for="showURL"> | ||
Show tab URL | ||
</label> | ||
</div> | ||
<div className="optionTip"> | ||
Shows the URL of the tab in addition to its title | ||
</div> | ||
</li> | ||
<li> | ||
<div> | ||
<input type="checkbox" id="collapse" /> | ||
<label className="label" for="collapse"> | ||
Dense tab list | ||
</label> | ||
</div> | ||
<div className="optionTip"> | ||
List tabs without a lot of space in between them | ||
</div> | ||
<ul className="options"> | ||
<li> | ||
<div> | ||
<input type="checkbox" id="separate" /> | ||
<label className="label" for="separate"> | ||
Show separators | ||
</label> | ||
</div> | ||
<div className="optionTip"> | ||
Shows separators between each tab in the list | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
<select value={this.state.theme} name="select" onChange={this.changeTheme}> | ||
{Object.keys(themes).map(theme => ( | ||
<option value={theme} selected={this.state.theme === theme}> | ||
{theme} | ||
</option> | ||
))} | ||
</select> | ||
</li> | ||
</ul> | ||
</section> | ||
</main> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
import Options from './components/options.jsx'; | ||
|
||
ReactDOM.render(<Options/>, document.getElementById('options')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export default { | ||
light: { | ||
navigation: '#009688', | ||
placeholder: 'rgba(255, 255, 255, 0.8)', | ||
main: '#ffffff', | ||
tab: { | ||
title: '#212121', | ||
link: '#9e9e9e' | ||
} | ||
}, | ||
dark: { | ||
navigation: '#1e1e1e', | ||
placeholder: 'rgba(255, 255, 255, 0.4)', | ||
main: '#1c1c1c', | ||
tab: { | ||
title: '#e1e1e1', | ||
link: '#a5a5a5' | ||
}, | ||
options: { | ||
header: '', | ||
main: '' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters