From f85db235c079e1d74aacc57e45b8fa9cf901ce4e Mon Sep 17 00:00:00 2001 From: Renee Pinna Date: Sun, 22 Oct 2023 15:52:08 -0600 Subject: [PATCH] Refactor Org Dash --- .../OrganizationDashboard.js | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/Components/OrganizationDashboard/OrganizationDashboard.js b/src/Components/OrganizationDashboard/OrganizationDashboard.js index e95416a..ead870e 100644 --- a/src/Components/OrganizationDashboard/OrganizationDashboard.js +++ b/src/Components/OrganizationDashboard/OrganizationDashboard.js @@ -1,10 +1,10 @@ -import React, { useState, useEffect } from 'react'; -import { useQuery } from '@apollo/client'; -import OrgRequestCard from '../OrgRequestCard/OrgRequestCard'; +import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; +import { useQuery } from '@apollo/client'; import { GET_ONE_ORG } from '../../apollo-client/queries'; -import '../OrganizationDashboard/OrganizationDashboard.scss'; +import OrgRequestCard from '../OrgRequestCard/OrgRequestCard'; import Spinner from '../Spinner/Spinner'; +import '../OrganizationDashboard/OrganizationDashboard.scss'; export default function OrganizationDashboard({ orgId }) { const navigate = useNavigate(); @@ -38,31 +38,36 @@ export default function OrganizationDashboard({ orgId }) { return

No organization data available.

; } - const organization = data.organization; + const { + name, + contactPhone, + contactEmail, + streetAddress, + website, + city, + state, + zip, + } = data.organization; return (
-

Welcome, {organization.name}!

- +

Welcome, {name}!

Aid Requests

{aidRequests.map(request => ( - + ))}

Organization Details

-

Phone: {organization.contactPhone}

-

Email: {organization.contactEmail}

-

Address: {organization.streetAddress}

-

Website: {organization.website}

-

City: {organization.city}

-

State: {organization.state}

-

ZIP: {organization.zip}

+

Phone: {contactPhone}

+

Email: {contactEmail}

+

Address: {streetAddress}

+

Website: {website}

+

City: {city}

+

State: {state}

+

ZIP: {zip}