connected close button
This commit is contained in:
parent
fc8b005b8a
commit
8b763fbb73
@ -1,4 +1,6 @@
|
|||||||
import React, {Component} from "react";
|
import React, {Component} from "react";
|
||||||
|
import {socket} from "../index";
|
||||||
|
import {EventName} from "../types";
|
||||||
|
|
||||||
export type ModalProps = {
|
export type ModalProps = {
|
||||||
show: boolean,
|
show: boolean,
|
||||||
@ -66,7 +68,11 @@ export class ClosePositionModal extends Component<ModalProps, any> {
|
|||||||
<button type="button"
|
<button type="button"
|
||||||
className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
|
className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
|
||||||
onClick={event => {
|
onClick={event => {
|
||||||
console.log("Closing " + this.props.positionId)
|
socket.emit(EventName.ClosePosition, {
|
||||||
|
position_id: this.props.positionId
|
||||||
|
})
|
||||||
|
|
||||||
|
this.props.toggleConfirmation()
|
||||||
}}>
|
}}>
|
||||||
Close
|
Close
|
||||||
</button>
|
</button>
|
||||||
|
@ -46,5 +46,6 @@ export enum EventName {
|
|||||||
NewTick = "new_tick",
|
NewTick = "new_tick",
|
||||||
FirstConnect = "first_connect",
|
FirstConnect = "first_connect",
|
||||||
NewEvent = "new_event",
|
NewEvent = "new_event",
|
||||||
|
ClosePosition = "close_position"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user