Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made some small css changes to observation details #639

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions resources/assets/js/components/ObservationDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,25 +279,25 @@ export default class ObservationDetails extends Component {
let confirmation = this.state.confirmation

return (
<div>
<div className="flexbox observation-tools">
<a className="button is-outlined"
<div style={{marginTop: '-20px'}}>
<div className="observation-tools" >
<a className="button is-outlined" style={{marginTop: '20px'}}
onClick={() => this.setState({controlModalContent: 'collection', showControlModal: true})}>
<span className="icon is-small">
<i className="fa fa-star text-success"></i>
</span>
<span>Add to Collection</span>
</a>
{User.owns(observation) ?
<a className="button is-outlined"
<a className="button is-outlined" style={{marginTop: '20px'}}
onClick={() => this.setState({showShareLinkModal: true})}>
<span className="icon is-small">
<i className="fa fa-share text-success"></i>
</span>
<span>Share Link</span>
</a> : null}
{observation.flags.length === 0 ?
<a className="button is-outlined"
<a className="button is-outlined" style={{marginTop: '20px'}}
onClick={() => this.setState({controlModalContent: 'flag', showControlModal: true})}>
<span className="icon is-small">
<i className="fa fa-flag text-danger"></i>
Expand All @@ -306,17 +306,19 @@ export default class ObservationDetails extends Component {
</a>
: null}
{User.can('contact users') ?
<a className="button is-outlined"
<a className="button is-outlined" style={{marginTop: '20px'}}
onClick={() => this.setState({showEmail: true})}>
<span className="icon is-small">
<i className="fa fa-envelope text-info"></i>
</span>
<span>Contact Submitter</span>
</a>
: null}
<div className="flex-row">

{User.can('confirm species') ?
<a className={`button is-outlined is-clear${confirmation.id !== -1 && !confirmation.correct ? ' is-active' : ''}`}
onClick={() => this.confirm(false, observation)} >
<a style={{marginTop: '20px'}}className={`mr-2 button is-outlined is-clear${confirmation.id !== -1 && !confirmation.correct ? ' is-active' : ''}`}
onClick={() => this.confirm(false, observation)} >
<Tooltip label={confirmation.id !== -1 && !confirmation.correct ? 'Undo' : 'Mark as incorrect species'}
hideOnClick={false}>
<span>{this.state.incorrectMarks}</span>
Expand All @@ -326,16 +328,16 @@ export default class ObservationDetails extends Component {
<span>Marks</span>
</Tooltip>
</a> :
<div className={`disabled`}>
<div className="disabled" style={{width: 'fit-content'}}>
<span>{this.state.incorrectMarks}</span>
<span className="icon is-small ml-1 mr-1">
<b className="fa fa-times text-danger"></b>
</span>
<span>Marks</span>
</div>}
{User.can('confirm species') ?
<a className={`button is-outlined is-clear${confirmation.id !== -1 && confirmation.correct ? ' is-active' : ''}`}
onClick={() => this.confirm(true, observation)}>
<a style={{marginTop: '20px'}} className={`button is-outlined is-clear${confirmation.id !== -1 && confirmation.correct ? ' is-active' : ''}`}
onClick={() => this.confirm(true, observation)}>
<Tooltip label={confirmation.id !== -1 && confirmation.correct ? 'Undo' : 'Confirm species'}
hideOnClick={false}>
<span>{this.state.correctMarks}</span>
Expand All @@ -345,14 +347,15 @@ export default class ObservationDetails extends Component {
<span>Marks</span>
</Tooltip>
</a> :
<div className={`disabled`} >
<div className="disabled" style={{width: 'fit-content'}}>
<span>{this.state.correctMarks}</span>
<span className="icon is-small ml-1 mr-1">
<b className="fa fa-check text-success"></b>
</span>
<span>Marks</span>
</div>}
</div>
</div>
</div>

{this._renderControlModal()}

Expand Down
14 changes: 14 additions & 0 deletions resources/assets/sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,17 @@ a.box {
flex-direction: row;
}

.flex{
display: flex;
}
.flex-row{
display: flex;
flex-direction: row;
}
.flex-col{
display: flex;
flex-direction: column;
}
.fit-content{
width: fit-content;
}