diff --git a/.cache/325c8f456729b912b0d2134054eb7448-dfeeb2271cc2857eb0a45a5003c8bbee b/.cache/325c8f456729b912b0d2134054eb7448-dfeeb2271cc2857eb0a45a5003c8bbee new file mode 100644 index 000000000..f7e9f79b1 --- /dev/null +++ b/.cache/325c8f456729b912b0d2134054eb7448-dfeeb2271cc2857eb0a45a5003c8bbee @@ -0,0 +1 @@ +{"value":{"success":true,"data":{"latest":{"version":"4.0.0","info":{"plain":"- upgrade webpack & babel to latest\n- new addParameters and third argument to .add to pass data to addons\n- added the ability to theme storybook\n- improved ui for mobile devices\n- improved performance of addon-knobs"}}},"time":1541422002878},"type":"Object"} \ No newline at end of file diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index f526f1740..f65644619 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -27,7 +27,7 @@ module.exports = { loader: 'css-loader', options: { modules: true, - localIdentName: '[hash:base64:5]', + localIdentName: '[path][name]_[local]_[hash:base64:5]', importLoaders: 2 } }, diff --git a/src/common/UserPanel/UserPanel.js b/src/common/UserPanel/UserPanel.js index adcf92c29..fdad54a0b 100644 --- a/src/common/UserPanel/UserPanel.js +++ b/src/common/UserPanel/UserPanel.js @@ -33,22 +33,22 @@ const UserPanel = (props) => { Fullscreen mode
- + Settings - + Add-ons
Play Magnet Link
- + Help & Feedback
- Terms of Service - About Stremio + Terms of Service + About Stremio
); diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index fb8068e31..6724afa15 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -1,41 +1,92 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; +import Icon from 'stremio-icons/dom'; import styles from './styles'; -import SettingsExpanded from './SettingsExpanded'; class Settings extends Component { constructor(props) { super(props); this.state = { - selectedMenu: 'player_preferences' + selectedMenu: 'player_preferences', + selectedMenuId: 0 } - - this.changeSettings = this.changeSettings.bind(this); } - changeSettings(selectedMenu) { - this.setState({ selectedMenu }); + changeSettings = (selectedMenu, id) => { + this.setState({ selectedMenu, selectedMenuId: id }); } - render() { + renderPlayerPreferences = () => { + const preferences = ["Hardware-accelerated decoding", "Auto-play next episode", "Data saver"]; + return ( -
-
- { this.changeSettings('player_preferences') }} className={styles['option']}>Player Preferences - { this.changeSettings('language') }} className={styles['option']}>Language - Account Setttings - Notifications - Data Caching -
- +
+ {preferences.map((item, key) => { + return ( + + ); + })}
); } + + renderLanguage = () => { + return ( +
+
+ INTERFACE LANGUAGE +
English + +
+
+
+ DEFAULT SUBTITLES LANGUAGE +
Portugese - BR + +
+
+
+ ); + } + + renderSelectedMenu = () => { + const { selectedMenuId } = this.state; + + if (selectedMenuId == 0) { + this.selectedMenu = 'player-preferences'; + return ( +
{this.renderPlayerPreferences()}
+ ); + } else if (selectedMenuId == 1) { + this.selectedMenu = 'language'; + return ( +
{this.renderLanguage()}
+ ); + } + } + + render() { + const { selectedMenu } = this.state; + const options = ["Player Preferences", "Language", "Account Settings", "Notifications", "Data Caching"]; + + return ( +
+
+ {options.map((key, index) => +
this.changeSettings(selectedMenu, index)}>{options[index]}
+ )} +
+ {this.renderSelectedMenu()} +
+ ) + } } -Settings.propTypes = { - changeSettings: PropTypes.func -}; - export default Settings; \ No newline at end of file diff --git a/src/routes/Settings/SettingsExpanded.js b/src/routes/Settings/SettingsExpanded.js deleted file mode 100644 index acfbf0c1b..000000000 --- a/src/routes/Settings/SettingsExpanded.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import Icon from 'stremio-icons/dom'; -import styles from './styles'; - -class SettingsExpanded extends Component { - constructor(props) { - super(props); - - this.renderPlayerPreferences = this.renderPlayerPreferences.bind(this); - this.renderLanguage = this.renderLanguage.bind(this); - } - - renderPlayerPreferences = () => { - const preferences = ["Auto-play next episode", "Data saver"]; - - return ( -
- - {preferences.map((item, key) => { - return ( - - ); - })} -
- ); - } - - renderLanguage = () => { - return ( -
-
- INTERFACE LANGUAGE -
English - -
-
-
- DEFAULT SUBTITLES LANGUAGE -
Portugese - BR - -
-
-
- ); - } - - render() { - const { selectedMenu } = this.props; - - if (selectedMenu == "player_preferences") { - return ( -
{this.renderPlayerPreferences()}
- ); - } else if (selectedMenu == "language") { - return ( -
{this.renderLanguage()}
- ); - } - } -} - -SettingsExpanded.propTypes = { - selectedMenu: PropTypes.string, - renderPlayerPreferences: PropTypes.func, - renderLanguage: PropTypes.func -}; - -export default SettingsExpanded; \ No newline at end of file diff --git a/src/routes/Settings/styles.less b/src/routes/Settings/styles.less index 6dc154649..af52137ca 100644 --- a/src/routes/Settings/styles.less +++ b/src/routes/Settings/styles.less @@ -20,13 +20,20 @@ background: @colorglass; } } + .selected-menu { + padding: 14px; + font-weight: 600; + cursor: pointer; + color: @colorwhite; + background: @colorglass; + } .selected { cursor: pointer; color: @colorwhite; background: @colorglass; } } - .player-preferences { + .player-preferences-menu { height: 150px; margin: 60px 50px; border-bottom: 1px solid @colormedium; @@ -34,7 +41,6 @@ display: flex; cursor: pointer; margin: 30px 0px; - justify-content: space-between; align-items: center; .preference { width: 280px; @@ -65,47 +71,8 @@ color: @colorwhite; } } - .preference-container1 { - display: flex; - cursor: pointer; - margin: 30px 0px; - align-items: center; - flex-direction: row-reverse; - .preference { - width: 280px; - } - input { - visibility: hidden; - } - .slider { - cursor: pointer; - position: absolute; - border-radius: 50px; - width: 22px; - height: 10px; - background-color: @colorneutral; - } - .slider:before { - position: absolute; - border-radius: 50%; - content: ""; - height: 14px; - width: 14px; - bottom: -2px; - transition: .4s; - -webkit-transition: .4s; - background-color: @colorwhite; - } - input:checked + .slider:before { - transform: translateX(8px); - background-color: @colorsignal5; - } - input:checked ~ .preference { - color: @colorwhite; - } - } } - .language { + .language-menu { margin: 40px 50px; .interface-language { margin-bottom: 30px;