Add API Documentation in the page About

parent b4c80b81
......@@ -3,13 +3,13 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.16.2",
"axios": "^0.19.0",
"create-react-app": "^1.3.3",
"documentation": "^9.3.1",
"leaflet": "^1.5.1",
"react": "^16.8.4",
"react": "^16.9.0",
"react-cookie": "^2.0.8",
"react-dom": "^16.8.4",
"react-dom": "^16.9.0",
"react-leaflet": "^2.4.0",
"react-materialize": "2.3.3",
"react-router": "^4.1.1",
......
......@@ -50,5 +50,6 @@
<!-- And then your bundled js -->
<!--<script src="path/to/your/bundle.js"></script>-->
<script defer="defer" src="//barra.brasil.gov.br/barra_2.0.js" type="text/javascript"></script>
<script src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</body>
</html>
......@@ -24,6 +24,8 @@ import React from 'react';
import NavigationBar from './Components/NavigationBar'
import { Tabs, Tab, Card, Row, Col} from 'react-materialize'
import { Store } from './Store'
import DocApi from './SubPages/DocApi'
import './Styles/About.css'
/**
......@@ -112,7 +114,7 @@ function Acessibilidade() {
function About() {
const { state, dispatch } = React.useContext(Store);
var states = { "SOBRE": false, "ACESSIBILIDADE": false }
var states = { "SOBRE": false, "ACESSIBILIDADE": false, "API": false }
if (state.page.toUpperCase() in states) {
states[state.page.toUpperCase()] = true
}
......@@ -145,6 +147,9 @@ function About() {
<Tab title="Acessibilidade" active={states["ACESSIBILIDADE"]}>
{ states["ACESSIBILIDADE"] ? <Acessibilidade /> : <div/> }
</Tab>
<Tab title="API" active={states["API"]}>
{ states["API"] ? <DocApi/> : <div/> }
</Tab>
</Tabs>
</div>
</div>
......
This diff is collapsed.
/*
Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of Portal-SMPPIR-React.
Portal-SMPPIR-React is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Portal-SMPPIR-React is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
*/
// This component was made using RapiDoc : https://mrin9.github.io/RapiDoc/
import React, { Component } from 'react';
import { Card, Row, Col } from 'react-materialize';
import definition from '../SMPPIR-API_Specification.yaml'
import C3SLLogo from '../Images/C3SL.png';
/**
* @name DocApi
*/
class DocApi extends Component {
render() {
return (
<div>
<Row/>
<Row>
<Col s={12}>
<Card>
Para fazer consultas com mais parâmetros insira todos os parâmetros que deseja,
separe-os por vírgula e pressione enter. Se entrar com cada parâmetro separando-os
com enter não irá funcionar
</Card>
</Col>
</Row>
<Row>
<Col s={12}>
<Card>
<rapi-doc
spec-url={definition}
theme={'light'}
header-color={'#FFFFFF'}
primary-color={'#0e3958'}
allow-spec-url-load={'false'}
allow-spec-file-load={'false'}
allow-search={'false'}
>
<img
slot="logo"
src={C3SLLogo}
height="45px"
width="57px"
alt={'C3SL logo'}
/>
</rapi-doc>
</Card>
</Col>
</Row>
</div>
);
}
}
export default DocApi;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment