Skip to content
Snippets Groups Projects
Commit 250ef165 authored by pdg16's avatar pdg16 Committed by Gabriel Silva Hermida
Browse files

initial commit

parent d4cdd47f
No related branches found
No related tags found
3 merge requests!7Issue #11: Criar Header,!6Issue #11: Criar Header,!4Issue #10: Cleaning Develop
Showing
with 15188 additions and 0 deletions
node_modules/
## BUILD
# Preqrequisite packages
`npm install`
`npm install react-router-dom`
`npm install axios`
# Development
`npm run build`
# Produção
`REACT_APP_STAGE="production" npm run build`
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
This diff is collapsed.
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.8.3",
"@material-ui/icons": "^4.5.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"material-ui": "^0.20.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
public/favicon.ico

3.78 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
public/logo192.png

5.22 KiB

public/logo512.png

9.44 KiB

{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
import React from 'react';
import { HashRouter, Route } from 'react-router-dom';
import CreateForm from './pages/CreateForm';
import AnswerForm from './pages/AnswerForm';
function App() {
return (
<HashRouter>
<Route path="/create" component={CreateForm} />
<Route path="/answer/:id" component={AnswerForm} />
</HashRouter>
);
}
export default App;
\ No newline at end of file
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import AddCircleIcon from '@material-ui/icons/AddCircle';
import CloseIcon from '@material-ui/icons/Close';
import Switch from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
function FieldFooterOptions(props) {
return (
<>
<FormControlLabel
control={
<Switch
onChange={e => props.setRequiredField(props.idq) }
value="required"
color="primary"
checked={props.required}
/>
}
label="Obrigatória"
/>
<IconButton aria-label="delete" onClick={() => { props.deleteFromForm(props.idq) } }>
<DeleteOutlinedIcon />
</IconButton>
</>
);
}
export default FieldFooterOptions;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import AddCircleIcon from '@material-ui/icons/AddCircle';
import CloseIcon from '@material-ui/icons/Close';
import Switch from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Typography from '@material-ui/core/Typography';
import Checkbox from '@material-ui/core/Checkbox';
import FieldFooterOptions from './FieldFooterOptions';
const useStyles = makeStyles(theme => ({
paper: {
padding: theme.spacing(3),
width: theme.spacing(100),
minheight: theme.spacing(16),
margin: theme.spacing(2)
},
questionsGrid: {
marginBottom: '20px'
},
}));
function FormFieldCheckbox(props) {
const classes = useStyles();
const options = props.options.map(function(x) {
return <span>{x.value} <Checkbox /></span>;
});
return (
<Paper className={classes.paper}>
<Grid container>
<Grid item xs={12} className={classes.questionsGrid}>
<Typography variant="h6" gutterBottom>
{props.question}
</Typography>
</Grid>
<Grid item container
direction="column"
justify="flex-start"
alignItems="flex-start" xs={5} className={classes.questionsGrid}
>
{options}
</Grid>
</Grid>
</Paper>
);
}
export default FormFieldCheckbox;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import AddCircleIcon from '@material-ui/icons/AddCircle';
import CloseIcon from '@material-ui/icons/Close';
import Switch from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Typography from '@material-ui/core/Typography';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import FieldFooterOptions from './FieldFooterOptions';
const useStyles = makeStyles(theme => ({
paper: {
padding: theme.spacing(3),
width: theme.spacing(100),
minheight: theme.spacing(16),
margin: theme.spacing(2)
},
questionsGrid: {
marginBottom: '20px'
},
}));
function FormFieldRadio(props) {
const classes = useStyles();
const [selectedValue, setSelectedValue] = React.useState();
const handleChange = event => {
setSelectedValue(event.target.value);
};
const options = props.options.map(function(x) {
return <span>
{x.value}
<Radio checked={selectedValue === x.value}
onChange={handleChange}
value={x.value}
/>
</span>;
});
return (
<Paper className={classes.paper}>
<Grid container>
<Grid item xs={12} className={classes.questionsGrid}>
<Typography variant="h6" gutterBottom>
{props.question}
</Typography>
</Grid>
<Grid item container
direction="column"
justify="flex-start"
alignItems="flex-start" xs={5} className={classes.questionsGrid}
>
<RadioGroup>
{options}
</RadioGroup>
</Grid>
</Grid>
</Paper>
);
}
export default FormFieldRadio;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import AddCircleIcon from '@material-ui/icons/AddCircle';
import CloseIcon from '@material-ui/icons/Close';
import Switch from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Typography from '@material-ui/core/Typography';
import FieldFooterOptions from './FieldFooterOptions';
const useStyles = makeStyles(theme => ({
paper: {
padding: theme.spacing(3),
width: theme.spacing(100),
minheight: theme.spacing(16),
margin: theme.spacing(2)
},
questionsGrid: {
marginBottom: '20px'
},
}));
function FormFieldSelect(props) {
const classes = useStyles();
const options = props.options.map(function(x) {
return <MenuItem value={x.value}>{x.value}</MenuItem>;
});
return (
<Paper className={classes.paper}>
<Grid container>
<Grid item xs={12} className={classes.questionsGrid}>
<Typography variant="h6" gutterBottom>
{props.question}
</Typography>
</Grid>
<Grid item container
direction="column"
justify="flex-start"
alignItems="flex-start" xs={5} className={classes.questionsGrid}
>
<Select
labelId="demo-simple-select-label"
id="demo-simple-select"
// onChange={handleChange}
>
{options}
</Select>
</Grid>
</Grid>
</Paper>
);
}
export default FormFieldSelect;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import FieldFooterOptions from './FieldFooterOptions';
const useStyles = makeStyles(theme => ({
paper: {
padding: theme.spacing(3),
width: theme.spacing(100),
height: theme.spacing(16),
margin: theme.spacing(2)
},
questionsGrid: {
marginBottom: '20px'
},
}));
function FormFieldText(props) {
const classes = useStyles();
return (
<Paper className={classes.paper}>
<Grid container>
<Grid item xs={12} className={classes.questionsGrid}>
<Typography variant="h6" gutterBottom>
{props.question}
</Typography>
</Grid>
<Grid item xs={9} className={classes.questionsGrid}>
<TextField
id="outlined-disabled"
label=""
placeholder="Resposta curta"
/>
</Grid>
<Grid item container
direction="row"
justify="flex-end"
alignItems="flex-end"
xs={3}
>
</Grid>
</Grid>
</Paper>
);
}
export default FormFieldText;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import FieldFooterOptions from './FieldFooterOptions';
const useStyles = makeStyles(theme => ({
paper: {
padding: theme.spacing(3),
width: theme.spacing(100),
height: theme.spacing(16),
margin: theme.spacing(2)
},
questionsGrid: {
marginBottom: '20px'
},
title: {
fontSize: 'xx-large'
},
description: {
fontSize: 'x-large'
},
}));
function FormFieldText(props) {
const classes = useStyles();
return (
<Paper className={classes.paper}>
<Grid container>
<Grid item xs={12} className={classes.questionsGrid}>
<Typography variant="h3" gutterBottom>
{props.title}
</Typography>
</Grid>
<Grid item xs={9} className={classes.questionsGrid}>
<Typography variant="h4" gutterBottom>
{props.description}
</Typography>
</Grid>
<Grid item container
direction="row"
justify="flex-end"
alignItems="flex-end"
xs={3}
>
</Grid>
</Grid>
</Paper>
);
}
export default FormFieldText;
\ No newline at end of file
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import TextField from '@material-ui/core/TextField';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import IconButton from '@material-ui/core/IconButton';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import AddCircleIcon from '@material-ui/icons/AddCircle';
import CloseIcon from '@material-ui/icons/Close';
import Switch from '@material-ui/core/Switch';
import FormControlLabel from '@material-ui/core/FormControlLabel';
function FieldFooterOptions(props) {
return (
<>
<FormControlLabel
control={
<Switch
onChange={e => props.setRequiredField(props.idq) }
value="required"
color="primary"
checked={props.required}
/>
}
label="Obrigatória"
/>
<IconButton aria-label="delete" onClick={() => { props.deleteFromForm(props.idq) } }>
<DeleteOutlinedIcon />
</IconButton>
</>
);
}
export default FieldFooterOptions;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment