deps: react-bootstrap 0.31 -> 2 (Bootstrap 5 CSS deferred as debt)
Removes the largest batch of React-19-blocking warnings: the 0.31 components (Grid, FormGroup, ControlLabel, Navbar.Header/Brand, Checkbox, SafeAnchor) all leaned on legacy context / defaultProps. 29 files converted: Grid->Container, FormGroup/ControlLabel/FormControl/ HelpBlock -> Form.Group/Label/Control/Text, Checkbox -> Form.Check (label as prop), bsStyle->variant (default->secondary), bsSize->size, pull-right->float-end. Custom Col.js now re-exports v2's Col; custom NavItem.js rewritten self-contained (no SafeAnchor/createChainedFunction); Navigation.js drops react-bootstrap Navbar (raw markup anyway). CSS stays on Bootstrap 4 (alexwine:bootstrap-4) for now: the BS4->5 jump is entangled with the jQuery carousel/swipe + navbar-collapse and is tracked as separate debt in UPGRADE.md. Only .form-label needed a shim (forms.scss). Browser-verified home carousel+navbar, signup form + terms checkbox, login form; REST smoke byte-identical.
This commit is contained in:
parent
12bdbe8fed
commit
a1a1b9a801
30 changed files with 539 additions and 333 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Row, FormGroup, ControlLabel, Button } from 'react-bootstrap';
|
||||
import { Row, Form, Button } from 'react-bootstrap';
|
||||
import _ from 'lodash';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
|
|
@ -164,8 +164,8 @@ class Profile extends React.Component {
|
|||
return !loading ? (<div>
|
||||
<Row>
|
||||
<Col xs={6}>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Nombre')}</ControlLabel>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Nombre')}</Form.Label>
|
||||
<input
|
||||
type="text"
|
||||
name="firstName"
|
||||
|
|
@ -173,11 +173,11 @@ class Profile extends React.Component {
|
|||
ref={firstName => (this.firstName = firstName)}
|
||||
className="form-control"
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form.Group>
|
||||
</Col>
|
||||
<Col xs={6}>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Apellidos')}</ControlLabel>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Apellidos')}</Form.Label>
|
||||
<input
|
||||
type="text"
|
||||
name="lastName"
|
||||
|
|
@ -185,11 +185,11 @@ class Profile extends React.Component {
|
|||
ref={lastName => (this.lastName = lastName)}
|
||||
className="form-control"
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Correo electrónico')}</ControlLabel>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Correo electrónico')}</Form.Label>
|
||||
<input
|
||||
type="email"
|
||||
name="emailAddress"
|
||||
|
|
@ -197,9 +197,9 @@ class Profile extends React.Component {
|
|||
ref={emailAddress => (this.emailAddress = emailAddress)}
|
||||
className="form-control"
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Idioma')}</ControlLabel>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Idioma')}</Form.Label>
|
||||
<div className="btn-group">
|
||||
<button className="btn btn-secondary btn-sm dropdown-toggle lang-selector" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{langName[i18n.language]}
|
||||
|
|
@ -219,18 +219,18 @@ class Profile extends React.Component {
|
|||
</div>
|
||||
</div>
|
||||
<InputHint><i className="fa fa-language"></i> <a href="https://translate.comunes.org/projects/todos-contra-el-fuego/" rel="noopener noreferrer" target="_blank">{this.t('Puedes participar en las traducciones')}</a></InputHint>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Contraseña actual')}</ControlLabel>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Contraseña actual')}</Form.Label>
|
||||
<input
|
||||
type="password"
|
||||
name="currentPassword"
|
||||
ref={currentPassword => (this.currentPassword = currentPassword)}
|
||||
className="form-control"
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<ControlLabel>{this.t('Nueva contraseña')}</ControlLabel>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>{this.t('Nueva contraseña')}</Form.Label>
|
||||
<input
|
||||
type="password"
|
||||
name="newPassword"
|
||||
|
|
@ -238,8 +238,8 @@ class Profile extends React.Component {
|
|||
className="form-control"
|
||||
/>
|
||||
<InputHint>{this.t('Usa al menos seis caracteres.')}</InputHint>
|
||||
</FormGroup>
|
||||
<Button id={testId('profileSubmit')} type="submit" bsStyle="success">{this.t('Guardar perfíl')}</Button>
|
||||
</Form.Group>
|
||||
<Button id={testId('profileSubmit')} type="submit" variant="success">{this.t('Guardar perfíl')}</Button>
|
||||
</div>) : <div />;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue