From 2bd110e64dd851282bd45ffc6b2333ed8d3ffb1f Mon Sep 17 00:00:00 2001 From: Anubhav Banerjee Date: Tue, 23 Jan 2024 18:32:20 +0530 Subject: [PATCH] Updated UI/UX of create, and updateOrg pages. Tweaked Mutations, and queries --- public/locales/en.json | 18 ++ src/GraphQl/Queries/Queries.ts | 2 +- .../LeftDrawerOrg/LeftDrawerOrg.tsx | 5 +- src/components/OrgListCard/OrgListCard.tsx | 15 +- src/components/OrgUpdate/OrgUpdate.tsx | 165 +++++++++++------- src/screens/OrgList/OrganizationModal.tsx | 154 +++++++++------- 6 files changed, 220 insertions(+), 139 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index d1fe7f8fba..9756f55cdb 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -128,6 +128,15 @@ "createSampleOrganization": "Create Sample Organization", "description": "Description", "location": "Location", + "address": "Address", + "city": "City", + "countryCode": "Country Code", + "dependentLocality": "Dependent Locality", + "line1": "Line 1", + "line2": "Line 2", + "postalCode": "Postal Code", + "sortingCode": "Sorting code", + "state": "State / Province", "userRegistrationRequired": "User Registration Required", "visibleInSearch": "Visible In Search", "displayImage": "Display Image", @@ -486,6 +495,15 @@ "name": "Name", "description": "Description", "location": "Location", + "address": "Address", + "city": "City", + "countryCode": "Country Code", + "line1": "Line 1", + "line2": "Line 2", + "postalCode": "Postal Code", + "dependentLocality": "Dependent Locality", + "sortingCode": "Sorting code", + "state": "State / Province", "displayImage": "Display Image", "userRegistrationRequired": "User Registration Required", "isVisibleInSearch": "Visible in Search", diff --git a/src/GraphQl/Queries/Queries.ts b/src/GraphQl/Queries/Queries.ts index f142713378..fa262775a3 100644 --- a/src/GraphQl/Queries/Queries.ts +++ b/src/GraphQl/Queries/Queries.ts @@ -262,7 +262,7 @@ export const ORGANIZATIONS_LIST = gql` name description address { - city: String + city countryCode dependentLocality line1 diff --git a/src/components/LeftDrawerOrg/LeftDrawerOrg.tsx b/src/components/LeftDrawerOrg/LeftDrawerOrg.tsx index e77b5aaaa5..940f94aef2 100644 --- a/src/components/LeftDrawerOrg/LeftDrawerOrg.tsx +++ b/src/components/LeftDrawerOrg/LeftDrawerOrg.tsx @@ -124,7 +124,10 @@ const leftDrawerOrg = ({
{organization.name} - {organization.address.city} + {organization.address.city}, {organization.address.state} +
+ {organization.address.postalCode},{' '} + {organization.address.countryCode}
diff --git a/src/components/OrgListCard/OrgListCard.tsx b/src/components/OrgListCard/OrgListCard.tsx index 0d4fc2c15e..00509a418e 100644 --- a/src/components/OrgListCard/OrgListCard.tsx +++ b/src/components/OrgListCard/OrgListCard.tsx @@ -61,10 +61,17 @@ function orgListCard(props: InterfaceOrgListCardProps): JSX.Element {

{name}

{address && address.city && ( -
- - {address.city} -
+
+
+ + {address.city}, + {address.state} +
+ + {address.postalCode}, + {address.countryCode} +
+
)}
{t('admins')}: {admins.length} diff --git a/src/components/OrgUpdate/OrgUpdate.tsx b/src/components/OrgUpdate/OrgUpdate.tsx index a6c484dc3c..acc380d7f4 100644 --- a/src/components/OrgUpdate/OrgUpdate.tsx +++ b/src/components/OrgUpdate/OrgUpdate.tsx @@ -109,7 +109,16 @@ function orgUpdate(props: InterfaceOrgUpdateProps): JSX.Element { id: orgId, name: formState.orgName, description: formState.orgDescrip, - address: formState.address, + address: { + city: formState.address.city, + countryCode: formState.address.countryCode, + dependentLocality: formState.address.dependentLocality, + line1: formState.address.line1, + line2: formState.address.line2, + postalCode: formState.address.postalCode, + sortingCode: formState.address.sortingCode, + state: formState.address.state, + }, userRegistrationRequired: userRegistrationRequiredChecked, visibleInSearch: visiblechecked, file: formState.orgImage, @@ -175,72 +184,94 @@ function orgUpdate(props: InterfaceOrgUpdateProps): JSX.Element { }} /> {t('address')} - handleInputChange('city', e.target.value)} - /> - handleInputChange('countryCode', e.target.value)} - /> - - handleInputChange('dependentLocality', e.target.value) - } - /> - handleInputChange('line1', e.target.value)} - /> - handleInputChange('line2', e.target.value)} - /> - handleInputChange('postalCode', e.target.value)} - /> - handleInputChange('sortingCode', e.target.value)} - /> - handleInputChange('state', e.target.value)} - /> + + + + handleInputChange('countryCode', e.target.value) + } + /> + + + handleInputChange('city', e.target.value)} + /> + + + + + handleInputChange('state', e.target.value)} + /> + + + + handleInputChange('dependentLocality', e.target.value) + } + /> + + + + + handleInputChange('line1', e.target.value)} + /> + + + handleInputChange('line2', e.target.value)} + /> + + + + + + handleInputChange('postalCode', e.target.value) + } + /> + + + + handleInputChange('sortingCode', e.target.value) + } + /> + + diff --git a/src/screens/OrgList/OrganizationModal.tsx b/src/screens/OrgList/OrganizationModal.tsx index bcfd600677..4918543dda 100644 --- a/src/screens/OrgList/OrganizationModal.tsx +++ b/src/screens/OrgList/OrganizationModal.tsx @@ -132,72 +132,94 @@ const OrganizationModal: React.FC = ({ }} /> {t('address')} - handleInputChange('city', e.target.value)} - /> - handleInputChange('countryCode', e.target.value)} - /> - - handleInputChange('dependentLocality', e.target.value) - } - /> - handleInputChange('line1', e.target.value)} - /> - handleInputChange('line2', e.target.value)} - /> - handleInputChange('postalCode', e.target.value)} - /> - handleInputChange('sortingCode', e.target.value)} - /> - handleInputChange('state', e.target.value)} - /> + + + + handleInputChange('countryCode', e.target.value) + } + /> + + + handleInputChange('city', e.target.value)} + /> + + + + + handleInputChange('state', e.target.value)} + /> + + + + handleInputChange('dependentLocality', e.target.value) + } + /> + + + + + handleInputChange('line1', e.target.value)} + /> + + + handleInputChange('line2', e.target.value)} + /> + + + + + + handleInputChange('postalCode', e.target.value) + } + /> + + + + handleInputChange('sortingCode', e.target.value) + } + /> + +