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

upload forms changed to look the same #216

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 12 additions & 8 deletions frontend/src/Store/Context.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const UserProvider = ({ children }) => {
const ReconciledRecordsSaved = JSON.parse(
localStorage.getItem('localData3') || '[]'
);
const ClearFileName = JSON.parse(
localStorage.removeItem('fileName') || '[]'
);


// Persisting data for uploaded files

Expand All @@ -40,18 +44,18 @@ export const UserProvider = ({ children }) => {
const [localFile, setLocalFile] = useState([]);
const [localFile2, setLocalFile2] = useState([]);

const [localData, setLocalData] = useState(AccountStatementsaved);
const [localData2, setLocalData2] = useState(SalesRecordsaved);
const [localData, setLocalData] = useState(AccountStatementsaved, ClearFileName);
const [localData2, setLocalData2] = useState(SalesRecordsaved, ClearFileName);

// reconcile data
const [localData3, setLocalData3] = useState(ReconciledRecordsSaved);
const [localData3, setLocalData3] = useState(ReconciledRecordsSaved, ClearFileName);
const [loading, setLoading] = useState(true);
const [uploadLoading, setUploadLoading] = useState(true);
const [uploadLoading2, setUploadLoading2] = useState(true);
const [rError, setRError] = useState('');

const [fileDropped, setFileDropped] = useState([]);
const [fileDropped2, setFileDropped2] = useState([]);
const [fileDropped, setFileDropped] = useState(ClearFileName);
const [fileDropped2, setFileDropped2] = useState(ClearFileName);

const uploadUrl = 'https://api.reconcileai.hng.tech/upload';
const reconcileUrl = `https://api.reconcileai.hng.tech/reconcile`;
Expand Down Expand Up @@ -181,9 +185,9 @@ export const UserProvider = ({ children }) => {
localStorage.clear()
setLocalData([]);
setLocalData2([]);
setFileDropped([]);
setFileDropped2([]);
setLocalData3([]);
setFileDropped(fileDropped);
setFileDropped2(fileDropped2);
setLocalData3(localData3);
};

const value = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ function Upload() {
inputRef.current.click();
}}
role="presentation"
<<<<<<< HEAD
className="flex flex-col items-center py-[4em] space-y-[2em] w-full md:w-[60%] lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939] cursor-pointer"
=======
className="flex flex-col items-center py-[2em] space-y-[2em] mb-[1em] w-full md:w-[60%] lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939]"
>>>>>>> 2331ab9ea7c1e4816afccd9cb801ca6ff1b7ca00
>
<img
src={document}
Expand All @@ -26,7 +30,7 @@ function Upload() {
/>
<div className="text-center space-y-[0.5em] ">
<h2 className=" font-bold text-[#344054] text-lg md:text-xl ">
Drop your account statement in here
Drag & Drop first record in here
</h2>
<p className="font-normal text-[#98A2B3] md:text-base text-sm">
Supported formats: .csv, .xls, .xlxs, .pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ function UploadReady() {
return (
<div className="space-y-[1em] w-full mt-[10%] lg:mt-[5%] flex flex-col items-center ">
<h1 className="font-bold text-2xl ">Ready for Upload</h1>
<<<<<<< HEAD
<div className="flex flex-col items-center py-[4em] space-y-[2em] w-full md:w-[60%] lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939] cursor-pointer">
=======
<div className="flex flex-col items-center py-[2em] space-y-[2em] mb-[1em] w-full md:w-[60%] lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939]">
>>>>>>> 2331ab9ea7c1e4816afccd9cb801ca6ff1b7ca00
{fileErr ? (
<img
src="https://icons.iconarchive.com/icons/hopstarter/sleek-xp-software/256/Windows-Close-Program-icon.png"
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/pages/Dashboard/ImportData/Hero/ImportData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ function ImportData() {

{fileValidationError && !uploadLoading && (
<ServerError />

)}


Expand All @@ -241,7 +242,7 @@ function ImportData() {

{localData2.length < 1 && (
<div className="space-y-[3em] w-full mt-[2em] ">
<h1 className="text-[1.5em] font-bold">Next, upload Sales Record</h1>
<h1 className="text-[1.5em] font-bold text-center">Upload Second Document</h1>
{showUpload ? (

<div className="flex flex-col justify-center items-center py-[2em] space-y-[2em] mb-[1em] w-full md:w-[60%] mx-auto lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939] bg-[#F2F4F7]">
Expand Down Expand Up @@ -300,7 +301,11 @@ function ImportData() {
setShowUpload(true);
setFileDropped2(e.dataTransfer?.files[0]);
}}
<<<<<<< HEAD
className="ml-[450px] flex flex-col items-center py-[4em] space-y-[2em] w-full md:w-[60%] lg:w-[40%] rounded-xl border-[2px] border-dashed border-[#1D2939] cursor-pointer"
=======
className="flex flex-col items-center py-[2em] space-y-[1em] mb-[1em] w-full md:w-[60%] lg:w-[40%] mx-auto rounded-xl border-[2px] border-dashed border-[#1D2939]"
>>>>>>> 2331ab9ea7c1e4816afccd9cb801ca6ff1b7ca00
>
<img
src={document}
Expand All @@ -310,7 +315,7 @@ function ImportData() {
{/* <CloudUploadIcon sx={{ fontSize: '5em', color: '#2E90FA' }} /> */}

<h2 className="font-bold text-[#344054] text-lg md:text-xl ">
Drag and drop sales record here.
Drag & Drop second document here.
</h2>
<p className="font-normal text-[#98A2B3] md:text-base text-sm">
Supported formats: PDF, Word DOCS, Excel
Expand Down