Skip to content

Commit

Permalink
Fixed button spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
roseeichelmann committed Jul 26, 2022
1 parent ef1d24d commit a9d41d2
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions atd-vze/src/views/Crashes/Notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Notes = ({ crashId }) => {
setEditedNote("");
}

//function to handle delete note button click
// function to handle delete note button click
const handleDeleteClick = (row) => {
const id = row.id
deleteNote({
Expand All @@ -99,15 +99,15 @@ const Notes = ({ crashId }) => {
<th style={{width: "10%"}}>
{fieldConfig.fields.date.label}
</th>
<th style={{width: "26%"}}>
<th style={{width: "24%"}}>
{fieldConfig.fields.user_email.label}
</th>
<th style={{width: "50%"}}>
<th style={{width: "54%"}}>
{fieldConfig.fields.text.label}
</th>
<th style={{width: "7%"}}>
<th style={{width: "6%"}}>
</th>
<th style={{width: "7%"}}>
<th style={{width: "6%"}}>
</th>
</tr>
<tbody>
Expand All @@ -126,12 +126,14 @@ const Notes = ({ crashId }) => {
onChange={e => setNewNote(e.target.value)}
/>
</td>
<td>
<td style={{padding: "12px 4px 12px 12px"}}>
<Button
type="submit"
color="primary"
onClick={handleAddNoteClick}
className="btn-pill mt-2"
size="sm"
style={{width: "50px"}}
>
Add
</Button>
Expand Down Expand Up @@ -164,40 +166,40 @@ const Notes = ({ crashId }) => {
})}
{/* display edit button if user has edit permissions */}
{!isReadOnly(roles) && !isEditing &&
<td>
<td style={{padding: "12px 4px 12px 12px"}}>
<Button
type="submit"
color="secondary"
size="sm"
className="btn-pill mt-2"
style={{ width: "50px" }}
style={{width: "50px"}}
onClick={e => handleEditClick(row)}
>
<i className="fa fa-pencil edit-toggle" />
</Button>
</td>}
{/* display delete button if user has edit permissions */}
{!isReadOnly(roles) && !isEditing &&
<td>
<td style={{padding: "12px 4px 12px 4px"}}>
<Button
type="submit"
color="secondary"
className="btn-pill mt-2"
size="sm"
style={{ width: "50px" }}
style={{width: "50px"}}
onClick={e => handleDeleteClick(row)}
>
<i className="fa fa-trash" />
</Button>
</td>}
{/* display accept button if user is editing */}
{!isReadOnly(roles) && isEditing &&
<td>
<td style={{padding: "12px 4px 12px 12px"}}>
<Button
color="primary"
className="btn-pill mt-2"
size="sm"
style={{ width: "50px" }}
style={{width: "50px"}}
onClick={e => handleCheckClick(row)}
>
<i className="fa fa-check edit-toggle" />
Expand All @@ -206,13 +208,13 @@ const Notes = ({ crashId }) => {
}
{/* display cancel button if user is editing */}
{!isReadOnly(roles) && isEditing &&
<td>
<td style={{padding: "12px 4px 12px 4px"}}>
<Button
type="submit"
color="danger"
className="btn-pill mt-2"
size="sm"
style={{ width: "50px" }}
style={{width: "50px"}}
onClick={e => handleCancelClick(e)}
>
<i className="fa fa-times edit-toggle" />
Expand Down

0 comments on commit a9d41d2

Please sign in to comment.