on master help sign in
Merge pull request #168 from urbit/fix/cleanup-props

fix: clean up the spreading of props to StatelessTransaction

commit5988a8a77668e82900c1309b3fe08e6138b02351 authorMatt Condon <mattgcondon@gmail.com> dateMon 17 Jun 2019, 16:52 (7 years ago) parent23ed93bb771fe9
7 files changed+24−44
src/bridge/Bridge.js+24−26 src/bridge/views/AcceptTransfer.js−3 src/bridge/views/CancelTransfer.js−3 src/bridge/views/CreateGalaxy.js−3 src/bridge/views/InvitesManage.js−3 src/bridge/views/IssueChild.js−3 src/bridge/views/SetProxy.js−3
src/bridge/Bridge.js+24−26
@@ -50,11 +50,11 @@ const kInitialPointCursor = kIsStubbed ? Just(0) : Nothing();
5050
5151// the router itself is just a component that renders a specific view
5252// depending on the history
53−const Router = function(props) {
53+const Router = function() {
5454 const history = useHistory();
5555 const Route = router(history.peek());
5656
57− return <Route {...props} />;
57+ return <Route />;
5858};
5959
6060// NB(shrugs): separate component because it needs useHistory
@@ -90,33 +90,31 @@ const AllProviders = nest([
9090 TxnCursorProvider,
9191]);
9292
93−class Bridge extends React.Component {
94− render() {
95− return (
96− <AllProviders
97− initialRoutes={kInitialRoutes}
98− initialNetworkType={kInitialNetworkType}
99− initialWallet={kInitialWallet}
100− initialMnemonic={kInitialMnemonic}
101− initialPointCursor={kInitialPointCursor}>
102− <Container>
103− <Row>
104− <VariableWidthColumn>
105− <Header />
93+function Bridge() {
94+ return (
95+ <AllProviders
96+ initialRoutes={kInitialRoutes}
97+ initialNetworkType={kInitialNetworkType}
98+ initialWallet={kInitialWallet}
99+ initialMnemonic={kInitialMnemonic}
100+ initialPointCursor={kInitialPointCursor}>
101+ <Container>
102+ <Row>
103+ <VariableWidthColumn>
104+ <Header />
106105
107− <Row className={'row wrapper'}>
108− <Router />
106+ <Row className={'row wrapper'}>
107+ <Router />
109108
110− <div className={'push'} />
111− </Row>
109+ <div className={'push'} />
110+ </Row>
112111
113− <Footer />
114− </VariableWidthColumn>
115− </Row>
116− </Container>
117− </AllProviders>
118− );
119− }
112+ <Footer />
113+ </VariableWidthColumn>
114+ </Row>
115+ </Container>
116+ </AllProviders>
117+ );
120118}
121119
122120export default Bridge;
src/bridge/views/AcceptTransfer.js−3
@@ -108,9 +108,6 @@ class AcceptTransfer extends React.Component {
108108 </Anchor>
109109
110110 <StatelessTransaction
111− // Upper scope
112− {...props}
113− // Other
114111 canGenerate={canGenerate}
115112 createUnsignedTxn={this.createUnsignedTxn}
116113 ref={this.statelessRef}
src/bridge/views/CancelTransfer.js−3
@@ -65,9 +65,6 @@ class CancelTransfer extends React.Component {
6565
6666 <P>{`This action will cancel the transfer to ${proxy}.`}</P>
6767 <StatelessTransaction
68− // Upper scope
69− {...props}
70− // Other
7168 canGenerate={canGenerate}
7269 createUnsignedTxn={this.createUnsignedTxn}
7370 />
src/bridge/views/CreateGalaxy.js−3
@@ -183,9 +183,6 @@ class CreateGalaxy extends React.Component {
183183 </Button>
184184
185185 <StatelessTransaction
186− // Upper scope
187− {...props}
188− // Other
189186 ref={this.statelessRef}
190187 canGenerate={canGenerate}
191188 createUnsignedTxn={this.createUnsignedTxn}
src/bridge/views/InvitesManage.js−3
@@ -172,9 +172,6 @@ class InvitesManage extends React.Component {
172172 </Input>
173173
174174 <StatelessTransaction
175− // Upper scope
176− {...this.props}
177− // Other
178175 canGenerate={this.state.canGenerate}
179176 createUnsignedTxn={this.createUnsignedTxn}
180177 ref={this.statelessRef}
src/bridge/views/IssueChild.js−3
@@ -243,9 +243,6 @@ class IssueChild extends React.Component {
243243 </Anchor>
244244
245245 <StatelessTransaction
246− // Upper scope
247− {...props}
248− // Other
249246 canGenerate={canGenerate}
250247 createUnsignedTxn={this.createUnsignedTxn}
251248 ref={this.statelessRef}
src/bridge/views/SetProxy.js−3
@@ -157,9 +157,6 @@ class _SetProxy extends React.Component {
157157 {addressInput}
158158
159159 <StatelessTransaction
160− // Upper scope
161− {...props}
162− // Other
163160 ref={this.statelessRef}
164161 createUnsignedTxn={this.createUnsignedTxn}
165162 canGenerate={canGenerate}