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

Mask currency #20

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
962cb1e
Inclusão de logo
dubcom Oct 8, 2021
918cf11
Novo layout
dubcom Oct 8, 2021
4012db5
Correção de textos
dubcom Oct 8, 2021
3957673
atualização
dubcom Oct 8, 2021
65ac2bb
Novas marcas
dubcom Oct 8, 2021
2aebcc4
Merge branch 'master' of https://github.com/compromitto/React-Firebas…
dubcom Oct 8, 2021
beee6f2
Incluso logo
dubcom Oct 8, 2021
942ddf9
Delete ._ForgotPassword.js
dubcom Oct 8, 2021
2da0f6a
Delete package-lock.json
dubcom Oct 8, 2021
ac1088e
Alteraçoes de logo
dubcom Oct 8, 2021
8687b78
Merge branch 'master' of https://github.com/compromitto/React-Firebas…
dubcom Oct 8, 2021
6712d3a
add new logo and fix deps
dubcom Oct 8, 2021
034c043
Merge pull request #1 from compromitto/features/change-layout
dubcom Oct 8, 2021
13bf782
Update README.md
dubcom Oct 8, 2021
bb82f73
Update README.md
dubcom Oct 8, 2021
a6aaec8
Button
dubcom Oct 9, 2021
ff1a9c0
Merge branch 'master' of https://github.com/compromitto/React-Firebas…
dubcom Oct 9, 2021
d478db3
Login with google
dubcom Oct 12, 2021
c149153
remove user the const
dubcom Oct 12, 2021
e8cb340
Redirect after login
dubcom Oct 12, 2021
4e56241
Merge pull request #2 from compromitto/features/change-layout
dubcom Oct 12, 2021
30109b3
Changer login with Google
dubcom Oct 12, 2021
aabef6c
Change css dark
dubcom Oct 13, 2021
8a536b9
background news
dubcom Oct 13, 2021
f85b990
add client form
dubcom Oct 14, 2021
db4787c
Creat new client
dubcom Oct 14, 2021
5b0dd81
database write e read
dubcom Oct 16, 2021
8b5dc18
Profile update
dubcom Oct 22, 2021
6ce4b69
change CI false
dubcom Oct 22, 2021
301b25a
remove CI false
dubcom Oct 22, 2021
d93b27c
Inclusão de marcas e personalização
dubcom Oct 28, 2021
092de17
Create ubdate
dubcom Oct 29, 2021
ed7eb4f
Update App.js
dubcom Oct 29, 2021
48479cd
interface new
dubcom Oct 29, 2021
57ad6ae
logout and update
dubcom Nov 1, 2021
26c2a99
gerando QRCode estático
dubcom Nov 23, 2021
233d36e
Erro na importação do pix
dubcom Nov 23, 2021
59406f2
form add value
dubcom Nov 23, 2021
161b7ab
pix import
dubcom Nov 23, 2021
7cd8748
import pix module
dubcom Nov 23, 2021
c85ffa1
fix pix.js import class ESmodule to coomnjs
dubcom Nov 24, 2021
0947bfc
fix import
dubcom Nov 24, 2021
8449d7b
change name class
dubcom Nov 25, 2021
b6bb6b2
change data base format
dubcom Dec 1, 2021
1af79f7
Merge branch 'master' of https://github.com/compromitto/React-Firebas…
dubcom Dec 1, 2021
bf112a9
New DB structure
dubcom Dec 2, 2021
45627ed
update QRCode
dubcom Dec 3, 2021
fc81e28
Update QRCode.js
dubcom Dec 3, 2021
38e3426
update
dubcom Dec 3, 2021
7f17047
Update Profile.js
dubcom Dec 3, 2021
591fbb8
remove accents
dubcom Dec 7, 2021
4ad494f
redirect user
dubcom Dec 7, 2021
a02f33a
creanting mask test
dubcom Dec 10, 2021
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
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

deploy in [vercel](https://react-firebase-auth-mu.vercel.app/)



## Available Scripts

In the project directory, you can run:

### `npm start`
### `yarn 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`
### `yarn 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`
### `yarn 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.
Expand All @@ -27,7 +31,7 @@ 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`
### `yarn run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

Expand Down
14,916 changes: 0 additions & 14,916 deletions package-lock.json

This file was deleted.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "firebase-react-auth",
"version": "0.1.0",
"name": "GeraPIX",
"version": "0.2.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/react": "^17.0.33",
"bootstrap": "^4.5.2",
"firebase": "^7.20.0",
"bootstrap-icons": "^1.5.0",
"firebase": "^8.6.7",
"qrcode.react": "^1.0.1",
"react": "^16.13.1",
"react-bootstrap": "^1.3.0",
"react-currency-masked-input": "^2.5.0",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3"
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 8 additions & 31 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<html lang="pt_BR">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="shortcut icon" href="favicon.png" />
<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"
content="Criando um sistema de gerar PIX online"
/>
<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>

<title>:: Gera .. PIX ::</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`.
-->
<noscript>You need to enable JavaScript to run this APP.<br>
Você necessita do JavaScript abilitado para rodar o APP</noscript>
<div class="text-white bg-secondary" id="root"></div>
</body>
</html>
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
8 changes: 4 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Gera Pix",
"name": "Projeto para criar um gerador de pix online",
"icons": [
{
"src": "favicon.ico",
"src": "favicon.png",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
Expand All @@ -21,5 +21,5 @@
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"background_color": "#343a3f"
}
11 changes: 11 additions & 0 deletions src/components/AmontFormat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import numeral from 'numeral';



const UINumeral = ({format, children}) => {
return (
<span>{numeral(children).format(format)}</span>
);
};
export default UINumeral;
25 changes: 19 additions & 6 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,45 @@ import Signup from "./Signup"
import { Container } from "react-bootstrap"
import { AuthProvider } from "../contexts/AuthContext"
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"
import Dashboard from "./Dashboard"
import Dashboard from "./Creatkey"
import UpData from "./UpdateData"
import Login from "./Login"
import PrivateRoute from "./PrivateRoute"
import ForgotPassword from "./ForgotPassword"
import UpdateProfile from "./UpdateProfile"
import Profile from "./Profile"
import GerarValor from "./GeraValor"
import GenerationQRCode from "./QRCode"



function App() {
return (

<Container
className="d-flex align-items-center justify-content-center"
style={{ minHeight: "100vh" }}
>
<div className="w-100" style={{ maxWidth: "400px" }}>
className="d-flex align-items-center justify-content-center "
style={{ minHeight: "100vh" }} >
<div className="p-3 mb-2 w-100" style={{ maxWidth: "400px" }}>
<Router>
<AuthProvider>
<Switch>
<PrivateRoute exact path="/" component={Dashboard} />
{<PrivateRoute exact path="/" component={Profile} />}
<Route path="/profile" component={Profile} />
<PrivateRoute path="/update-profile" component={UpdateProfile} />
<Route path="/signup" component={Signup} />
<Route path="/login" component={Login} />
<Route path="/Creatkey" component={Dashboard} />
<Route path="/forgot-password" component={ForgotPassword} />
<Route path="/UpData" component={UpData} />
<Route path="/GerarValor" component={GerarValor} />
<Route path="/QRCode" component={GenerationQRCode} />
</Switch>
</AuthProvider>
</Router>

</div>
</Container>

)
}

Expand Down
132 changes: 132 additions & 0 deletions src/components/Creatkey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import React, {useState } from "react"
import { Form, Card, Button, Alert } from "react-bootstrap"
import { useAuth } from "../contexts/AuthContext"
import { Link, useHistory } from "react-router-dom"

import firebase from 'firebase'
import 'firebase/database'


import logo from '../image/logo.png'

export default function Dashboard() {

const [error, setError] = useState("")
const { currentUser, logout } = useAuth()
const history = useHistory()



async function handleLogout() {
setError("")

try {
await logout()
history.push("/")
} catch {
setError("Falha para fazer logout")
}
}
// redirecionar sem login l

const user = firebase.auth().currentUser;
//criar database realtime

const [newChave, setNewChave] = useState('')
const [newCity, setNewcity] = useState('')
const [newName, setNewName] = useState('')



async function handCreatClient(event){
event.preventDefault()

if (newChave.trim()===''){
return
}
if (newName.trim()===''){
return
}
if (newCity.trim()===''){
return
}

const firebaseClient = {
name: newName,
authorId: currentUser?.uid,
city: newCity,
chave: newChave,
};

// await firebase.database().ref(`clients/${currentUser?.uid}`).push(firebaseClient);
await firebase.database().ref(`clients/${user?.uid}/key`).push(firebaseClient);


history.push("/GerarValor")

}
// fim do criar database

return (
<>
<Card className="text-white shadow bg-secondary rounded mb-2">
<div className="text-right">
<Button className="badge badge-secondary" variant="link" onClick={handleLogout}>
SAIR
</Button>

</div>

<Card.Body>
<div>
<img src={logo}alt="Gera pix" className="card-img-top" />
</div>

<h6 className="text-center font-weight-bold ">CONTA</h6>
{error && <Alert variant="danger">{error}</Alert>}
<div className="user-info text-center ">
<img className="rounded-circle text-center" src={currentUser.photoURL} alt={currentUser.displayName} />
<p className="font-weight-bold mb-4">{currentUser.displayName}</p>
<Link to="/update-profile" className="btn btn-primary btn-sm mt-8">
Atualizar senha
</Link>

</div>


</Card.Body>
</Card>
<Card.Footer className="shadow p-3 mb-5 bg-dark text-white rounded p-3 mb-2">
<h2 className="text-center d-block mb-4">CRIE SUA CONTA PIX</h2>
<p className="text-center"> Coloque seus dados já cadastrado no seu banco para gerar o PIX com seus dados</p>
<Form onSubmit={handCreatClient}>
<Form.Group className="mb-4 mt-4"id="chave">
<Form.Label className="mb-0">Chave PIX</Form.Label>
<Form.Control type="text" name="newChave"required placeholder="Digite sua chave PIX"
onChange={(event) => setNewChave(event.target.value)}
/>
<small className="form-text text-muted">PIX cadastrada (Telefone, E-mail, CPF, CNPJ ou chave Aleatória) </small>
</Form.Group>
<Form.Group className="mb-4" id="name">
<Form.Label className="mb-0">Nome do beneficiário</Form.Label>
<Form.Control type="text" name="name" required placeholder="Nome beneficiário"
onChange={(event) => setNewName(event.target.value)}
/>
<small className="form-text text-muted">Nome do beneficiário (até 25 letras). </small>
</Form.Group>
<Form.Group className="mb-4" id="city">
<Form.Label className="mb-0">Digite a cidade</Form.Label>
<Form.Control type="text" name="city"required placeholder="Digite a cidade"
onChange={(event) => setNewcity(event.target.value)}
/>
<small className="mt-0 form-text text-muted">Cidade do beneficiário ou da transação (até 15 letras) </small>
</Form.Group>
<Button className="w-100" type="submit">
CRIAR CONTA
</Button>
</Form>
</Card.Footer>

</>
)
}
41 changes: 0 additions & 41 deletions src/components/Dashboard.js

This file was deleted.

Loading