Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  10] [ 2]  / answers: 1 / hits: 5335  / 4 Years ago, thu, april 16, 2020, 12:00:00

Ive been reading the documents and trying to find out if other people had the same questions. But i werent able to find any. Is there any way I can add space between the buttons? Right now they are right next to each other. Thanks!



import React from react;
import { connect } from react-redux;

class Todo extends React.Component {

state = {
color:null
}

render() {

let color;
if(this.props.todo.priorityLevel === 3 ) {
color = #ff5252 red accent-2;
} else if(this.props.todo.priorityLevel === 2) {
color = #ff8a65 deep-orange lighten-2;
} else {
color = #fff176 yellow lighten-2;
}

return(
<div className={card-panel + color}>
<div id=todoInfo>
<h2>{`Title: ${this.props.todo.todoTitle}`}</h2>
<span id=todoDescription>{`Description: ${this.props.todo.description}`}</span>
<span id=todoPriorityLevel>{`Priority Level: ${this.props.todo.priorityLevel}`}</span>
</div>
<div id=todoActions>
<button className=btn-floating btn-large cyan pulse actionButtons onClick={()=>this.props.dispatch({type:EDIT_TODO, id: this.props.todo.id})}>Edit</button>
<button className=btn waves-effect #d50000 red accent-4 pulse actionButtons onClick={()=>this.props.dispatch({type:DELETE_TODO, id: this.props.todo.id})}>Delete</button>
</div>
</div>

)
}
}

export default connect()(Todo);

More From » css

 Answers
1

Add style={{ marginRight: '40px !important' }} on the first button.



Alternatively, you might get a default gap if you use <a> tags instead of <button>


[#4127] Wednesday, April 15, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
micayla

Total Points: 148
Total Questions: 92
Total Answers: 109

Location: Aruba
Member since Sat, Oct 2, 2021
3 Years ago
micayla questions
Fri, Dec 24, 21, 00:00, 2 Years ago
Thu, Nov 14, 19, 00:00, 5 Years ago
Fri, Jan 25, 19, 00:00, 5 Years ago
;