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

Frontend/41 internal view demographics spreadsheet #55

Merged
merged 5 commits into from
Jan 15, 2025
Merged
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
Empty file added DemographicsSpreadsheet.tsx
Empty file.
117 changes: 117 additions & 0 deletions app/components/DemographicsSpreadsheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import React from "react";
import Image from 'next/image';
import deleteIcon from '../images/delete.png';
import arrowsIcon from "../images/upAndDownArrows.png";

interface DemographicsSpreadsheetProps {
demographicsItems: (string | number)[][][][];
}

export const DemographicsSpreadsheet: React.FC<DemographicsSpreadsheetProps> = ({ demographicsItems = [] }) => {
console.log("demographicsItems:", demographicsItems);

return(
<div className="relative overflow-x-auto crimson-regular font-crimson">
<table className="table-auto w-full">
<thead className ="font-crimson border- crimson-regular border-separate content-start">
<tr className="bg-dark-blue text-white text-lg align-left ">
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Date</p>
<Image src={arrowsIcon}
width={15}
height={15}
alt="arrows Icon"
className="">
</Image>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Phone Number</p>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Name</p>
<Image src={arrowsIcon}
width={15}
height={15}
alt="arrows Icon"
className="">
</Image>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Address</p>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>House Size</p>
<Image src={arrowsIcon}
width={15}
height={15}
alt="arrows Icon"
className="">
</Image>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Received</p>
<Image src={arrowsIcon}
width={15}
height={15}
alt="arrows Icon"
className="">
</Image>
</div>
</th>
<th className="border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">
<div className="font-[20px] flex flex-row justify-between">
<p>Donated</p>
<Image src={arrowsIcon}
width={15}
height={15}
alt="arrows Icon"
className="">
</Image>
</div>
</th>
<th className="font-[20px] border-collapse border-zinc-50 border-2 border-y-1 py-2 px-3">Actions</th>
</tr>
</thead>
<tbody className="bg-zinc-75 border-collapse border-zinc-400 font-crimson crimson-regular">
{demographicsItems.map((item, index) => (
<tr key={index} className="py-2">
{item.map((data, subIndex) => (
<td
key={subIndex}
className="border-collapse border-zinc-200 border-2 border-y-1 py-2 px-3"
>
{data}
</td>
))}
<td
key={`actions-${index}`}
className="flex row justify-around border-collapse border-zinc-300 border-2 border-y-1 py-2 px-3"
>
<Image
src={deleteIcon}
width={18}
height={18}
alt="delete Icon"
className=""
/>
</td>
</tr>
))}
</tbody>
</table>
</div>

)

}
106 changes: 106 additions & 0 deletions app/components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"use client"
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import React from 'react';
import Image from 'next/image';
import whiteOutlineLogo from '@app/images/headerLogo.png';
import dropArrow from '@app/images/Vector.png';
import initials from '@app/images/group2.png';
import face from '@app/images/Frame6.png';
import settings from '@app/images/Frame7.png';
import icon from '@app/images/Frame8.png';
import downArrow2 from '@app/images/downArrow.png';

export default function NavBar() {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const router = useRouter();

const handleSignOut = () => {
router.push("/login/page");
};

const handleInventory = () => {
router.push("/inventory/page");
};

return (
<>
<div className="relative w-full h-[120px] bg-banner-green flex items-center shadow-xl">
{/* Logo Section */}
<div className="flex-shrink-0 mr-8">
<Image
src={whiteOutlineLogo}
alt="logo"
width={160}
height={130}
/>
</div>

{/* Navigation Links */}
<div className="flex space-x-40">
<button className="text-[24px] font-crimson font-bold
text-white px-6 py-3 rounded-xl bg-transparent hover:bg-[#D9D9D9]">
Demographics
</button>
<button className="text-[24px] font-crimson font-bold
text-white px-6 py-3 rounded-xl bg-transparent hover:bg-[#D9D9D9]"
onClick={handleInventory}>
Inventory
</button>
<button className="text-[24px] font-crimson font-bold
text-white px-6 py-3 rounded-xl bg-transparent hover:bg-[#D9D9D9]">
Categories
</button>
</div>

<div className="absolute right-10 flex items-center space-x-4">

{/* User Initials */}
<Image
src={initials}
alt="initial_letters"
width={51}
height={51}
className="rounded-full"
/>

{/* User Name and Dropdown */}
<div className="relative">
<button
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
className="flex items-center text-[24px] font-crimson font-bold text-white">
Glen McLeod
<Image
src={isDropdownOpen ? downArrow2 : dropArrow}
alt="drop-down-arrow"
width={isDropdownOpen ? 25 : 8.59}
height={isDropdownOpen ? 30 : 14.85}
className="ml-2"
/>
</button>
{/* Dropdown Menu */}
{isDropdownOpen && (
<div className="absolute right-0 mt-2 bg-white rounded-xl shadow-lg w-48 z-50">
<ul>
<li className="flex items-center text-[24px] font-crimson font-bold px-4 py-2 hover:bg-[#ECF9E9] cursor-pointer">
<Image src={face} alt="logo" width={24} height={24} className="mr-2" />
My Profile
</li>
<li className="flex items-center text-[24px] font-crimson font-bold px-4 py-2 hover:bg-[#ECF9E9] cursor-pointer">
<Image src={settings} alt="settings-logo" width={24} height={24} className="mr-2" />
Settings
</li>
<li className="flex items-center text-[24px] font-crimson font-bold px-4 py-2 hover:bg-[#ECF9E9] cursor-pointer"
onClick={handleSignOut}>
<Image src={icon} alt="icon" width={24} height={24} className="mr-2" />
Sign Out
</li>
</ul>
</div>
)}
</div>
</div>
</div>
</>
);
}
31 changes: 31 additions & 0 deletions app/demographics/[[...demographics]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";
import NavBar from "@app/components/NavBar";
import { DemographicsSpreadsheet } from "@app/components/DemographicsSpreadsheet";

const InternalViewDemographicsPage: React.FC = () => {
const demographicsItems = [
["2024-01-01", "(415)273-3832", "Tanisha", "10 winthrop st", 2, 3, 1],
["2024-01-02", "(344)343-3343", "Emily", "2 Medford ave", 2, 4, 3],
["2004-01-03", "(234)382-8392", "Karen", "15 Lane ave", 2, 5, 7],
["2024-01-03", "(234)338-2362", "Baren", "15 Lane ave", 4, 5, 7],
["2024-01-05", "(234)322-4392", "Kathy", "15 Lane ave", 1, 2, 7],
["2023-01-03", "(234)383-1392", "Bob", "15 Lane ave", 2, 6, 7],
["1999-01-03", "(323)438-5392", "Tyler", "15 Lane ave", 2, 5, 9],
];

return (
<div className="p-4">
<h1 className="text-3xl font-[40px] font-bold mb-4">Demographic Responses</h1>
<DemographicsSpreadsheet demographicsItems={demographicsItems} />
</div>
);
};

export default function DemographicsPage() {
return (
<>
<NavBar />
<InternalViewDemographicsPage />
</>
);
}
Binary file added app/images/Frame6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/Frame7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/Frame8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/Vector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/downArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/group2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added drop-down-arrow-TE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading