-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5faeee8
commit 7d554c4
Showing
17 changed files
with
514 additions
and
201 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { LoadingTransactionItem } from "./core/LoadingTransactionItem" | ||
|
||
export const AnimatedLoader = () => { | ||
return ( | ||
<div> | ||
<div className="flex flex-col w-full text-4xl font-bold text-center select-none py-10 fade-in scrl"> | ||
<div> | ||
Total: | ||
<span className="bg-slate-200 text-slate-200 mx-2 rounded-xl animate-pulse">sum</span> | ||
</div> | ||
<div className="flex justify-center w-full text-4xl font-bold text-center items-center"> | ||
<div className="flex flex-row flex-wrap justify-around text-lg font-bold my-5"> | ||
<p className="bg-slate-50 text-slate-100 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer animate-pulse"> | ||
<i className="fa-solid fa-filter mr-2"></i> | ||
Category | ||
</p> | ||
<p className="bg-slate-50 text-slate-100 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer animate-pulse"> | ||
<i className="fa-solid fa-filter mr-2"></i> | ||
Account | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex flex-wrap flex-row mx-auto justify-center items-center"> | ||
<div className="flex justify-center flex-wrap slide-r"> | ||
<LoadingTransactionItem /> | ||
<LoadingTransactionItem /> | ||
<LoadingTransactionItem /> | ||
<LoadingTransactionItem /> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Modal } from "flowbite-react" | ||
import { useState } from "react"; | ||
import { AccountFilter } from "../../hooks/AccountFilter"; | ||
|
||
type accountProp = { | ||
currentData: any; | ||
accountC: string; | ||
setAccountC: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
|
||
export const AccountFilterButton = (accountProps: accountProp) => { | ||
const [openModal, setOpenModal] = useState<string | undefined>(); | ||
const props = { openModal, setOpenModal }; | ||
|
||
// listen to escape key | ||
window.addEventListener('keydown', (event) => { | ||
if (event.key === 'Escape') { | ||
setOpenModal('false'); | ||
} | ||
}); | ||
|
||
return ( | ||
<div> | ||
<div | ||
onClick={() => ( | ||
props.setOpenModal('default') | ||
)}> | ||
<p className="bg-slate-50 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer fade-in"> | ||
<i className="fa-solid fa-filter mr-2"></i> | ||
Account | ||
</p> | ||
</div> | ||
|
||
<Modal dismissible className="fade-in h-screen" show={props.openModal === 'default'} onClose={() => props.setOpenModal(undefined)}> | ||
<Modal.Header className="bg-slate-100"> | ||
Select the Account | ||
</Modal.Header> | ||
<Modal.Body className="slide-up scrl2"> | ||
<div className="flex justify-between mt-5"> | ||
<AccountFilter | ||
dataBase={accountProps.currentData} | ||
accountC={accountProps.accountC} | ||
setAccountC={accountProps.setAccountC} /> | ||
</div> | ||
</Modal.Body> | ||
|
||
<Modal.Footer className="flex justify-around items-center bg-slate-100"> | ||
|
||
<button onClick={() => setOpenModal('false')} type="button" className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800">Save</button> | ||
|
||
</Modal.Footer> | ||
</Modal> | ||
</div> | ||
) | ||
} |
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,56 @@ | ||
import { Modal } from "flowbite-react" | ||
import { useState } from "react"; | ||
import { CategoryFilter } from "../../hooks/CategoryFilter"; | ||
|
||
type categoryProp = { | ||
currentData: any; | ||
categoryC: string; | ||
setCategoryC: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
|
||
export const CategoryFilterButton = (categoryProps: categoryProp) => { | ||
const [openModal, setOpenModal] = useState<string | undefined>(); | ||
const props = { openModal, setOpenModal }; | ||
|
||
// listen to escape key | ||
window.addEventListener('keydown', (event) => { | ||
if (event.key === 'Escape') { | ||
setOpenModal('false'); | ||
} | ||
}); | ||
|
||
return ( | ||
<div> | ||
<div | ||
onClick={() => ( | ||
props.setOpenModal('default') | ||
)}> | ||
<p className="bg-slate-50 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer fade-in"> | ||
<i className="fa-solid fa-filter mr-2"></i> | ||
Category | ||
</p> | ||
</div> | ||
|
||
<Modal dismissible className="fade-in h-screen" show={props.openModal === 'default'} onClose={() => props.setOpenModal(undefined)}> | ||
<Modal.Header className="bg-slate-100"> | ||
Select the Category | ||
</Modal.Header> | ||
<Modal.Body className="slide-up scrl2"> | ||
<div className="flex justify-between mt-5"> | ||
<CategoryFilter | ||
dataBase={categoryProps.currentData} | ||
categoryC={categoryProps.categoryC} | ||
setCategoryC={categoryProps.setCategoryC} /> | ||
</div> | ||
</Modal.Body> | ||
<Modal.Footer className="flex justify-around items-center bg-slate-100"> | ||
|
||
<button onClick={() => setOpenModal('false')} type="button" className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"> | ||
Close | ||
</button> | ||
|
||
</Modal.Footer> | ||
</Modal> | ||
</div> | ||
) | ||
} |
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,37 @@ | ||
import { androidColorToHex } from "../../utils/AndroidColorToHex"; | ||
|
||
type removeAccountProp = { | ||
accountC: string; | ||
setAccountC: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
|
||
export const RemoveAccountButton = (props: removeAccountProp) => { | ||
|
||
// fetch color from theData and set it to the backgroundColor | ||
const data = () => { | ||
const theData = localStorage.getItem('theData'); | ||
if (theData !== null) { | ||
const parsedData = JSON.parse(theData); | ||
console.log(parsedData) | ||
const account = parsedData.accounts.filter((item: any) => item.name === props.accountC); | ||
return account[0].color | ||
} | ||
|
||
return '' | ||
|
||
} | ||
|
||
// convert android color to hex | ||
const color = androidColorToHex(data()) | ||
|
||
|
||
return ( | ||
<p | ||
onClick={() => props.setAccountC('')} | ||
className="p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer fade-in" | ||
style={{ backgroundColor: color }}> | ||
{props.accountC} | ||
<i className="fa-solid fa-x ml-2"></i> | ||
</p> | ||
) | ||
} |
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,37 @@ | ||
import { androidColorToHex } from "../../utils/AndroidColorToHex"; | ||
|
||
type removeCategoryProp = { | ||
categoryC: string; | ||
setCategoryC: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
|
||
export const RemoveCategoryButton = (props: removeCategoryProp) => { | ||
|
||
// fetch color from theData and set it to the backgroundColor | ||
const data = () => { | ||
const theData = localStorage.getItem('theData'); | ||
if (theData !== null) { | ||
const parsedData = JSON.parse(theData); | ||
const category = parsedData.categories.filter((item: any) => item.name === props.categoryC); | ||
return category[0].color | ||
} | ||
|
||
|
||
return '' | ||
|
||
} | ||
|
||
// convert android color to hex | ||
const color = androidColorToHex(data()) | ||
|
||
|
||
return ( | ||
<p | ||
onClick={() => props.setCategoryC('')} | ||
className="p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer fade-in" | ||
style={{ backgroundColor: color }}> | ||
{props.categoryC} | ||
<i className="fa-solid fa-x ml-2"></i> | ||
</p> | ||
) | ||
} |
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,57 @@ | ||
import { useState } from "react"; | ||
import { Modal } from "flowbite-react"; | ||
import { JSONdata } from "../../services/JSONdata"; | ||
import { ClearData } from "../data/ClearData"; | ||
import DarkModeButton from "../layout/DarkModeButton"; | ||
|
||
export const SettingsButton = () => { | ||
const [openModal, setOpenModal] = useState<string | undefined>(); | ||
const props = { openModal, setOpenModal }; | ||
|
||
// listen to escape key | ||
window.addEventListener('keydown', (event) => { | ||
if (event.key === 'Escape') { | ||
setOpenModal('false'); | ||
} | ||
}); | ||
|
||
return ( | ||
<> | ||
<div className="flex flex-row align-middle justify-center items-center lg:w-48 max-lg:w-fit max-lg:h-fit p-5 m-1 rounded-2xl hover:shadow-sm cursor-pointer hover:brightness-95 transition duration-300 ease-in-out bg-slate-50 text-xl font-bold" | ||
onClick={() => ( | ||
props.setOpenModal('default') | ||
)}> | ||
<i className='fas fa-cog mr-2 max-lg:mr-0'></i> | ||
<div className="max-lg:hidden"> | ||
Settings | ||
</div> | ||
</div> | ||
|
||
<Modal className="fade-in h-screen" show={props.openModal === 'default'} onClose={() => props.setOpenModal(undefined)}> | ||
<Modal.Header className="bg-slate-100"> | ||
Settings | ||
</Modal.Header> | ||
<Modal.Body className="slide-up scrl2"> | ||
<div className="flex flex-col mt-5"> | ||
<div className="bg-sky-100 m-1 p-3 rounded-xl cursor-pointer hover:brightness-95"> | ||
<DarkModeButton /> | ||
</div> | ||
<div className="bg-sky-100 m-1 p-3 rounded-xl"> | ||
<JSONdata /> | ||
</div> | ||
<div className="bg-sky-100 m-1 p-3 rounded-xl"> | ||
<ClearData /> | ||
</div> | ||
</div> | ||
</Modal.Body> | ||
<Modal.Footer className="flex justify-around items-center bg-slate-100"> | ||
|
||
<button onClick={() => setOpenModal('false')} type="button" className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"> | ||
Close | ||
</button> | ||
|
||
</Modal.Footer> | ||
</Modal> | ||
</> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
export const LoadingTransactionItem = () => { | ||
return ( | ||
<div> | ||
<div className="p-5 lg:w-96 md:w-72 m-5 bg-slate-100 dark:bg-slate-800 rounded-2xl hover:shadow-lg cursor-default"> | ||
<p | ||
className="text-xl font-bold bg-slate-200 text-slate-200 mx-2 rounded-t-xl animate-pulse w-32"> | ||
March 01 | ||
</p> | ||
<p | ||
className="text-sm font-medium bg-slate-200 text-slate-200 mx-2 rounded-b-xl animate-pulse w-32"> | ||
Friday | ||
</p> | ||
|
||
<div className="flex flex-row flex-wrap justify-around text-lg font-bold my-5"> | ||
<div> | ||
<p className="bg-green-200 text-green-200 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer animate-pulse"> | ||
Category | ||
</p> | ||
</div> | ||
<div> | ||
<p className="bg-sky-200 text-sky-200 p-2 px-10 m-1 rounded-full hover:shadow-md cursor-pointer animate-pulse"> | ||
Account | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<p className="text-2xl font-bold my-3 bg-slate-200 text-slate-200 mx-2 rounded-xl animate-pulse"> | ||
title | ||
</p> | ||
<p className="bg-slate-200 text-slate-200 mx-2 rounded-xl animate-pulse my-3"> | ||
description | ||
</p> | ||
<p className='text-5xl font-extrabold ml-12 flex flex-wrap bg-slate-200 text-slate-200 mx-2 rounded-xl animate-pulse'> | ||
asds | ||
<abbr | ||
className="font-normal ml-2"> | ||
asd | ||
</abbr> | ||
</p> | ||
</div> | ||
|
||
</div> | ||
) | ||
} |
Oops, something went wrong.