metamaps--metamaps/src/routes/RequestAccess.js

40 lines
1,019 B
JavaScript
Raw Normal View History

2018-02-15 20:17:59 +00:00
import React, { Component } from 'react'
2018-02-15 20:17:59 +00:00
class RequestAccess extends Component {
render = () => {
return (
<div id="yield">
<div className='request_access'>
<div className='monkey'></div>
<div className='explainer_text'>
Hmmm. This map is private, but you can request to edit it from the map creator.
</div>
<div className='make_request'>REQUEST ACCESS</div>
</div>
</div>
)
}
}
2018-02-15 20:17:59 +00:00
export default RequestAccess
2018-02-15 20:17:59 +00:00
/*
<script>
$(document).ready(function() {
$('.make_request').click(function() {
var that = $(this)
that.off('click')
that.text('requesting...')
$.ajax({
url: '/maps/<%= params[:id] %>/access_request',
type: 'POST',
contentType: 'application/json',
statusCode: {
200: function () { that.text('Request Sent'); setTimeout(function () {window.location.href = '/'}, 2000) },
400: function () { that.text('An error occurred') }
}
})
})
})
</script>
2018-02-15 20:17:59 +00:00
*/