Skip to content

Commit

Permalink
Updated UI/UX of create, and updateOrg pages. Tweaked Mutations, and …
Browse files Browse the repository at this point in the history
…queries
  • Loading branch information
Anubhav-2003 committed Jan 23, 2024
1 parent 0a6ea56 commit 2bd110e
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 139 deletions.
18 changes: 18 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const ORGANIZATIONS_LIST = gql`
name
description
address {
city: String
city
countryCode
dependentLocality
line1
Expand Down
5 changes: 4 additions & 1 deletion src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ const leftDrawerOrg = ({
<div className={styles.profileText}>
<span className={styles.primaryText}>{organization.name}</span>
<span className={styles.secondaryText}>
{organization.address.city}
{organization.address.city}, {organization.address.state}
<br />
{organization.address.postalCode},{' '}
{organization.address.countryCode}
</span>
</div>
</button>
Expand Down
15 changes: 11 additions & 4 deletions src/components/OrgListCard/OrgListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ function orgListCard(props: InterfaceOrgListCardProps): JSX.Element {
<h4 className={styles.orgName}>{name}</h4>
</Tooltip>
{address && address.city && (
<h6 className="text-secondary">
<LocationOnIcon fontSize="inherit" className="fs-5" />
{address.city}
</h6>
<div>
<h6 className="text-secondary">
<LocationOnIcon fontSize="inherit" className="fs-5" />
<span className="address-line">{address.city}, </span>
<span className="address-line">{address.state}</span>
<br />
<LocationOnIcon fontSize="inherit" className="fs-5" />
<span className="address-line">{address.postalCode}, </span>
<span className="address-line">{address.countryCode}</span>
</h6>
</div>
)}
<h6>
{t('admins')}: <span>{admins.length}</span>
Expand Down
165 changes: 98 additions & 67 deletions src/components/OrgUpdate/OrgUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -175,72 +184,94 @@ function orgUpdate(props: InterfaceOrgUpdateProps): JSX.Element {
}}
/>
<Form.Label>{t('address')}</Form.Label>
<Form.Control
className="mb-4"
placeholder={t('city')}
autoComplete="off"
required
value={formState.address.city}
onChange={(e) => handleInputChange('city', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('countryCode')}
autoComplete="off"
required
value={formState.address.countryCode}
onChange={(e) => handleInputChange('countryCode', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('dependentLocality')}
autoComplete="off"
required
value={formState.address.dependentLocality}
onChange={(e) =>
handleInputChange('dependentLocality', e.target.value)
}
/>
<Form.Control
className="mb-4"
placeholder={t('line1')}
autoComplete="off"
required
value={formState.address.line1}
onChange={(e) => handleInputChange('line1', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('line2')}
autoComplete="off"
required
value={formState.address.line2}
onChange={(e) => handleInputChange('line2', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('postalCode')}
autoComplete="off"
required
value={formState.address.postalCode}
onChange={(e) => handleInputChange('postalCode', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('sortingCode')}
autoComplete="off"
required
value={formState.address.sortingCode}
onChange={(e) => handleInputChange('sortingCode', e.target.value)}
/>
<Form.Control
className="mb-4"
placeholder={t('state')}
autoComplete="off"
required
value={formState.address.state}
onChange={(e) => handleInputChange('state', e.target.value)}
/>
<Row className="mb-1">
<Col sm={6} className="mb-3">
<Form.Control
placeholder={t('countryCode')}
autoComplete="off"
required
value={formState.address.countryCode}
onChange={(e) =>
handleInputChange('countryCode', e.target.value)
}
/>
</Col>
<Col sm={6} className="mb-3">
<Form.Control
placeholder={t('city')}
autoComplete="off"
required
value={formState.address.city}
onChange={(e) => handleInputChange('city', e.target.value)}
/>
</Col>
</Row>
<Row className="mb-1">
<Col sm={6} className="mb-3">
<Form.Control
placeholder={t('state')}
autoComplete="off"
required
value={formState.address.state}
onChange={(e) => handleInputChange('state', e.target.value)}
/>
</Col>
<Col sm={6} className="mb-3">
<Form.Control
placeholder={t('dependentLocality')}
autoComplete="off"
required
value={formState.address.dependentLocality}
onChange={(e) =>
handleInputChange('dependentLocality', e.target.value)
}
/>
</Col>
</Row>
<Row className="mb-3">
<Col sm={6} className="mb-1">
<Form.Control
placeholder={t('line1')}
autoComplete="off"
required
value={formState.address.line1}
onChange={(e) => handleInputChange('line1', e.target.value)}
/>
</Col>
<Col sm={6} className="mb-1">
<Form.Control
placeholder={t('line2')}
autoComplete="off"
required
value={formState.address.line2}
onChange={(e) => handleInputChange('line2', e.target.value)}
/>
</Col>
</Row>
<Row className="mb-1">
<Col sm={6} className="mb-1">
<Form.Control
placeholder={t('postalCode')}
autoComplete="off"
required
value={formState.address.postalCode}
onChange={(e) =>
handleInputChange('postalCode', e.target.value)
}
/>
</Col>
<Col sm={6} className="mb-1">
<Form.Control
placeholder={t('sortingCode')}
autoComplete="off"
required
value={formState.address.sortingCode}
onChange={(e) =>
handleInputChange('sortingCode', e.target.value)
}
/>
</Col>
</Row>
<Row>
<Col sm={6} className="d-flex mb-3">
<Form.Label className="me-3">
Expand Down
Loading

0 comments on commit 2bd110e

Please sign in to comment.