From acd1d7f9e2a283dbe67b57eeaee2e8713e95be88 Mon Sep 17 00:00:00 2001 From: webdevstar Date: Mon, 15 Oct 2018 14:05:38 +0800 Subject: [PATCH] upload --- src/admin/.DS_Store | Bin 0 -> 6148 bytes src/admin/client/modules/.DS_Store | Bin 0 -> 6148 bytes src/admin/client/modules/apps/.DS_Store | Bin 0 -> 6148 bytes .../apps/account/components/account.js | 83 ++++++++++++++++ .../apps/account/components/details.js | 37 +++++++ .../apps/account/components/developer.js | 92 ++++++++++++++++++ .../modules/apps/account/components/style.css | 26 +++++ .../client/modules/apps/account/index.js | 38 ++++++++ 8 files changed, 276 insertions(+) create mode 100644 src/admin/.DS_Store create mode 100644 src/admin/client/modules/.DS_Store create mode 100644 src/admin/client/modules/apps/.DS_Store create mode 100755 src/admin/client/modules/apps/account/components/account.js create mode 100755 src/admin/client/modules/apps/account/components/details.js create mode 100755 src/admin/client/modules/apps/account/components/developer.js create mode 100755 src/admin/client/modules/apps/account/components/style.css create mode 100755 src/admin/client/modules/apps/account/index.js diff --git a/src/admin/.DS_Store b/src/admin/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ef82ecf21faacd9ab6b959ebf1f809df197588c8 GIT binary patch literal 6148 zcmeHKOKQU~5S>X)F?8c)mbyZ3AcA`WUm%c%5-={5HfyhPt{$y#J{#BVF4=@PFnZEx zo`l}Q;}H?veZ4-5bRyEi4dr6P+HBu^Wt)sB5RNk@`8*FF)A&BUt+M|P823>QGRjGg zzxcLCqXJZb3Qz$mKn1R=K-Smx>AJ`AG%7#^?mz+iJ`}iNO`HS$(}BTT0APc#8|L0i z0E-2HHE|9^1g1d+2351g(4Zq;GOs4ifk79|=0o#l%??HVcAQ^4U9<*rqyki6slY=l zJFEXM@PGRMC5bC4Kn3nf0d4xB-{DDFTUU>>T3g_IxaEAq%`kTg1~11zFUMF|Io^6w biGvE;K4|YXyD)bAA=5 literal 0 HcmV?d00001 diff --git a/src/admin/client/modules/.DS_Store b/src/admin/client/modules/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 { + return ( +
+
+ {messages.account} +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+
+
+ ); +}; + +export default reduxForm({ + form: 'WebStoreAccountForm', + enableReinitialize: true +})(AccountForm); diff --git a/src/admin/client/modules/apps/account/components/details.js b/src/admin/client/modules/apps/account/components/details.js new file mode 100755 index 0000000..f2130f5 --- /dev/null +++ b/src/admin/client/modules/apps/account/components/details.js @@ -0,0 +1,37 @@ +import React from 'react'; +import messages from 'lib/text'; +import style from './style.css'; +import Account from './account'; +import Developer from './developer'; + +export default class WebStoreAccountDetails extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + this.props.fetchData(); + } + + render() { + const { account, onAccountSubmit, onDeveloperSubmit } = this.props; + const developerData = account ? account.developer : null; + + if (account) { + return ( +
+ + {account && + account.is_developer === true && ( + + )} +
+ ); + } else { + return null; + } + } +} diff --git a/src/admin/client/modules/apps/account/components/developer.js b/src/admin/client/modules/apps/account/components/developer.js new file mode 100755 index 0000000..e1cc3c7 --- /dev/null +++ b/src/admin/client/modules/apps/account/components/developer.js @@ -0,0 +1,92 @@ +import React from 'react'; +import { Field, reduxForm } from 'redux-form'; +import { Link } from 'react-router-dom'; +import { TextField } from 'redux-form-material-ui'; + +import { CustomToggle } from 'modules/shared/form'; +import messages from 'lib/text'; +import style from './style.css'; + +import Paper from 'material-ui/Paper'; +import RaisedButton from 'material-ui/RaisedButton'; +import Divider from 'material-ui/Divider'; +import FontIcon from 'material-ui/FontIcon'; +import { List, ListItem } from 'material-ui/List'; + +const DeveloperForm = ({ + handleSubmit, + pristine, + submitting, + initialValues +}) => { + return ( +
+
+ {messages.developerProfile} +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+
+ ); +}; + +export default reduxForm({ + form: 'WebStoreDeveloperForm', + enableReinitialize: true +})(DeveloperForm); diff --git a/src/admin/client/modules/apps/account/components/style.css b/src/admin/client/modules/apps/account/components/style.css new file mode 100755 index 0000000..8fe62aa --- /dev/null +++ b/src/admin/client/modules/apps/account/components/style.css @@ -0,0 +1,26 @@ +.button { + margin-left: 12px; +} + +.toggle { + margin-top: 12px; + margin-bottom: 22px; +} + +.innerBox { + padding: 30px; +} + +.childrenBox { + padding: 0 30px 30px 30px; +} + +.error { + color: rgb(244, 67, 54); +} + +.detailsContainer { + display: flex; + flex-direction: column; + align-items: center; +} diff --git a/src/admin/client/modules/apps/account/index.js b/src/admin/client/modules/apps/account/index.js new file mode 100755 index 0000000..ebbcc4f --- /dev/null +++ b/src/admin/client/modules/apps/account/index.js @@ -0,0 +1,38 @@ +import { connect } from 'react-redux'; +import { + fetchAccount, + updateAccount, + updateDeveloperAccount +} from '../actions'; +import Details from './components/details'; +import * as webstoreAuth from 'lib/webstoreAuth'; + +const mapStateToProps = (state, ownProps) => { + return { + account: state.apps.account + }; +}; + +const mapDispatchToProps = (dispatch, ownProps) => { + return { + fetchData: () => { + const webstoreAuthorized = webstoreAuth.isCurrentTokenValid(); + if (webstoreAuthorized) { + dispatch(fetchAccount()); + } else { + ownProps.history.push('/admin/apps/login'); + } + }, + onAccountSubmit: values => { + dispatch(updateAccount(values)); + }, + onDeveloperSubmit: values => { + dispatch(updateDeveloperAccount(values)); + } + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(Details);