Add missing key prop to Dialog actions/secondaryActions

This commit is contained in:
Florian Rival
2019-08-23 18:54:24 +02:00
parent 04c37b6186
commit 829ce23dc2
15 changed files with 31 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ export default class EventsContextAnalyzerDialog extends React.Component<
const { onClose, eventsContextResult } = this.props;
const actions = [
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={true}
onClick={this.props.onClose}

View File

@@ -59,11 +59,13 @@ export default class InstructionEditorDialog extends React.Component<
} = this.props;
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
primary={false}
onClick={onCancel}
/>,
<FlatButton
key="ok"
label={<Trans>Ok</Trans>}
primary={true}
keyboardFocused={false}

View File

@@ -28,15 +28,18 @@ export default class VariablesEditorDialog extends Component {
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
keyboardFocused={true}
onClick={() => this.props.onClose(false)}
/>,
<FlatButton
key="remove"
label={<Trans>Remove objects</Trans>}
onClick={() => this.props.onClose(true, null)}
/>,
<FlatButton
key="move"
label={<Trans>Move objects</Trans>}
primary={true}
onClick={() => this.props.onClose(true, this.state.selectedLayer)}

View File

@@ -139,11 +139,13 @@ export default class AboutDialog extends PureComponent<Props, *> {
<Dialog
actions={[
<FlatButton
key="website"
label={<Trans>GDevelop Website</Trans>}
primary={false}
onClick={() => Window.openExternalURL('http://gdevelop-app.com')}
/>,
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={false}
onClick={onClose}

View File

@@ -13,11 +13,17 @@ export default class BetaIntroDialog extends Component {
const { open, onClose } = this.props;
const actions = [
<FlatButton
key="download"
label={<Trans>Download full GDevelop desktop version</Trans>}
primary={false}
onClick={this._onOpenWebsite}
/>,
<FlatButton label={<Trans>Ok</Trans>} primary={true} onClick={onClose} />,
<FlatButton
label={<Trans>Ok</Trans>}
primary={true}
onClick={onClose}
key="close"
/>,
];
return (

View File

@@ -23,6 +23,7 @@ export default class ChangelogDialog extends React.Component<Props, State> {
const actions = [
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={true}
onClick={onClose}

View File

@@ -30,11 +30,13 @@ export default class LayoutChooserDialog extends Component {
render() {
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
primary={false}
onClick={this.props.onClose}
/>,
<FlatButton
key="choose"
label={<Trans>Choose</Trans>}
primary={true}
keyboardFocused={true}

View File

@@ -91,6 +91,7 @@ export default class LanguageDialog extends Component<Props, State> {
onClose(false);
}}
disabled={isLoadingLanguage}
key="close"
/>,
]}
secondaryActions={[

View File

@@ -156,6 +156,7 @@ export default class DirectionTools extends Component<Props, State> {
label={<Trans>OK</Trans>}
primary
onClick={() => this.openPreview(false)}
key="ok"
/>
}
autoScrollBodyContent

View File

@@ -13,11 +13,13 @@ export class ObjectGroupEditorDialog extends Component {
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
keyboardFocused
onClick={this.props.onCancel}
/>,
<FlatButton
key="apply"
label={<Trans>Apply</Trans>}
primary
keyboardFocused

View File

@@ -213,11 +213,13 @@ export default class PlatformSpecificAssetsDialog extends React.Component<
render() {
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
primary={false}
onClick={this.props.onClose}
/>,
<FlatButton
key="apply"
label={<Trans>Apply</Trans>}
primary={true}
keyboardFocused={true}

View File

@@ -50,6 +50,7 @@ export default class CreateProjectDialog extends React.Component<Props, State> {
title={<Trans>Create a new game</Trans>}
actions={[
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={false}
onClick={onClose}

View File

@@ -34,11 +34,13 @@ export default class BrowserSaveDialog extends Component {
const actions = [
<FlatButton
key="download"
label={<Trans>Download GDevelop desktop version</Trans>}
primary={false}
onClick={() => Window.openExternalURL('http://gdevelop-app.com')}
/>,
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={false}
onClick={onClose}

View File

@@ -185,11 +185,13 @@ class GenericResourcesChooser extends Component {
const actions = [
<FlatButton
key="close"
label={<Trans>Close</Trans>}
primary={false}
onClick={this._onClose}
/>,
<FlatButton
key="choose"
label={<Trans>Choose</Trans>}
primary={false}
disabled={!this.state.chosenResourceUrl}

View File

@@ -22,11 +22,13 @@ export default class SetupGridDialog extends Component {
render() {
const actions = [
<FlatButton
key="cancel"
label={<Trans>Cancel</Trans>}
primary={false}
onClick={this.props.onCancel}
/>,
<FlatButton
key="apply"
label={<Trans>Apply</Trans>}
primary={true}
keyboardFocused={true}