This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Fastest-Coder-First/veersatech
- Loading branch information
Showing
20 changed files
with
440 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,131 @@ | ||
import React from "react"; | ||
import { Modal } from "react-bootstrap"; | ||
import React, { useState } from "react"; | ||
import { Modal, Button, Form, Container, Table } from "react-bootstrap"; | ||
|
||
const FinancesTable = () => { | ||
return <div></div>; | ||
const FinancesTable = (props) => { | ||
const { | ||
amount, | ||
setAmount, | ||
transactionType, | ||
setTransactionType, | ||
description, | ||
setDescription, | ||
category, | ||
setCategory, | ||
date, | ||
setDate, | ||
show, | ||
setShow, | ||
handleClose, | ||
} = props; | ||
|
||
// const [show, setShow] = useState(false); | ||
|
||
// const handleClose = () => setShow(false); | ||
|
||
const renderTableRows = () => { | ||
console.log("data", props.data); | ||
return props.data.map((item) => ( | ||
<tr key={item.id}> | ||
<td>{item.type}</td> | ||
<td>{item.name}</td> | ||
<td>{item.category}</td> | ||
<td>{item.date}</td> | ||
<td>{item.amount}</td> | ||
</tr> | ||
)); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Modal show={show} onHide={handleClose}> | ||
<Modal.Header closeButton> | ||
<Modal.Title>Create Transaction</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<Form onSubmit={props.handleSubmit}> | ||
<Form.Group controlId="amount"> | ||
<Form.Label>Amount</Form.Label> | ||
<Form.Control | ||
type="number" | ||
placeholder="Enter amount" | ||
value={amount} | ||
onChange={(e) => setAmount(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group controlId="transactionType"> | ||
<Form.Label>Transaction Type</Form.Label> | ||
<Form.Control | ||
as="select" | ||
value={transactionType} | ||
onChange={(e) => setTransactionType(e.target.value)} | ||
> | ||
<option value="Income">Income</option> | ||
<option value="Expense">Expense</option> | ||
</Form.Control> | ||
</Form.Group> | ||
<Form.Group controlId="category"> | ||
<Form.Label>Category</Form.Label> | ||
<Form.Control | ||
type="text" | ||
placeholder="Enter category" | ||
value={category} | ||
onChange={(e) => setCategory(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group controlId="description"> | ||
<Form.Label>Description</Form.Label> | ||
<Form.Control | ||
type="text" | ||
placeholder="Enter description" | ||
value={description} | ||
onChange={(e) => setDescription(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group controlId="date"> | ||
<Form.Label>Date</Form.Label> | ||
<Form.Control | ||
type="date" | ||
value={date} | ||
onChange={(e) => setDate(e.target.value)} | ||
/> | ||
</Form.Group> | ||
</Form> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button variant="secondary" onClick={handleClose}> | ||
Close | ||
</Button> | ||
<Button variant="primary" onClick={props.handleSubmit}> | ||
Save Transaction | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
|
||
<div className="d-flex justify-content-between align-items-center"> | ||
<h1>{props.name}</h1> | ||
|
||
<Button variant="primary" onClick={() => setShow(true)}> | ||
Add Transaction | ||
</Button> | ||
</div> | ||
|
||
<br /> | ||
<Container> | ||
<Table striped bordered hover> | ||
<thead> | ||
<tr> | ||
<th>Type</th> | ||
<th>Name</th> | ||
<th>Category</th> | ||
<th>Date</th> | ||
<th>Amount</th> | ||
</tr> | ||
</thead> | ||
<tbody>{renderTableRows()}</tbody> | ||
</Table> | ||
</Container> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FinancesTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { default as SearchFilters } from "./SearchFilters"; | ||
export { default as TableComponent } from "./TableComponent"; | ||
export { default as FinancesTable } from "./FinancesTable"; | ||
export { default as FinanceTable } from "./FinancesTable"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import React, { useState } from "react"; | ||
import NavbarComponent from "../Components/Common/NavbarComponent"; | ||
import { | ||
Button, | ||
Card, | ||
Col, | ||
Container, | ||
Row, | ||
Modal, | ||
Form, | ||
} from "react-bootstrap"; | ||
|
||
const AccountsPage = () => { | ||
const [bankName, setBankName] = useState(""); | ||
const [accountNumber, setAccountNumber] = useState(""); | ||
const [balance, setBalance] = useState(""); | ||
const accounts = [ | ||
{ bankName: "PNB", accountNumber: "1234", balance: "$34" }, | ||
{ bankName: "SBI", accountNumber: "1234", balance: "$34" }, | ||
{ bankName: "HDFC", accountNumber: "1234", balance: "$34" }, | ||
]; | ||
|
||
const [show, setShow] = useState(false); | ||
|
||
const handleClose = () => setShow(false); | ||
return ( | ||
<div> | ||
<Modal show={show} onHide={handleClose}> | ||
<Modal.Header closeButton> | ||
<Modal.Title>Create Transaction</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<Form onSubmit={() => {}}> | ||
<Form.Group controlId="amount"> | ||
<Form.Label>Account Name</Form.Label> | ||
<Form.Control | ||
type="number" | ||
placeholder="Enter account name" | ||
value={bankName} | ||
onChange={(e) => setBankName(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group controlId="transactionType"> | ||
<Form.Label>Account Code</Form.Label> | ||
<Form.Control | ||
type="number" | ||
placeholder="Enter account code" | ||
value={accountNumber} | ||
onChange={(e) => setAccountNumber(e.target.value)} | ||
/> | ||
</Form.Group> | ||
<Form.Group controlId="category"> | ||
<Form.Label>Account Type</Form.Label> | ||
<Form.Control | ||
type="text" | ||
placeholder="Account type" | ||
value={balance} | ||
onChange={(e) => setBalance(e.target.value)} | ||
/> | ||
</Form.Group> | ||
</Form> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button variant="secondary" onClick={handleClose}> | ||
Close | ||
</Button> | ||
<Button variant="primary" onClick={() => {}}> | ||
Save Transaction | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
<NavbarComponent /> | ||
<br /> | ||
<br /> | ||
<Container> | ||
{" "} | ||
{/* <h1>Accounts</h1> <br /> */} | ||
<div className="d-flex justify-content-between align-items-center"> | ||
<h1>Accounts</h1> | ||
|
||
<Button variant="primary" onClick={() => setShow(true)}> | ||
Add Transaction | ||
</Button> | ||
</div> | ||
<br /> | ||
<Row> | ||
{" "} | ||
{accounts.map((account, index) => ( | ||
<Col key={index} xs={12} md={6} lg={4}> | ||
{" "} | ||
<Card> | ||
{" "} | ||
<Card.Body> | ||
{" "} | ||
<Card.Title> | ||
<div | ||
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
}} | ||
> | ||
<div>{account.bankName}</div> | ||
<div> | ||
<input type="radio" /> | ||
</div> | ||
</div> | ||
</Card.Title>{" "} | ||
<Card.Text>Account Number: {account.accountNumber}</Card.Text>{" "} | ||
<Card.Text>Balance: {account.balance}</Card.Text>{" "} | ||
</Card.Body>{" "} | ||
</Card>{" "} | ||
</Col> | ||
))}{" "} | ||
</Row>{" "} | ||
</Container> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AccountsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.