-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1317/listings management, building details & intro (#1420)
- Loading branch information
1 parent
377a2e4
commit 4f926eb
Showing
16 changed files
with
253 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
sites/partners/src/listings/PaperListingDetails/sections/DetailBuildingDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useContext } from "react" | ||
import { t, GridSection, ViewItem, GridCell } from "@bloom-housing/ui-components" | ||
import { ListingContext } from "../../ListingContext" | ||
|
||
const DetailBuildingDetails = () => { | ||
const listing = useContext(ListingContext) | ||
|
||
return ( | ||
<GridSection | ||
className="bg-primary-lighter" | ||
title={t("listings.sections.buildingDetailsTitle")} | ||
grid={false} | ||
inset | ||
> | ||
<GridSection columns={3}> | ||
<GridCell span={2}> | ||
<ViewItem label={t("application.contact.streetAddress")}> | ||
{listing.buildingAddress.street} | ||
</ViewItem> | ||
</GridCell> | ||
<ViewItem label={t("t.neighborhood")}>{listing.neighborhood}</ViewItem> | ||
</GridSection> | ||
<GridSection columns={6}> | ||
<GridCell span={2}> | ||
<ViewItem label={t("application.contact.city")}>{listing.buildingAddress.city}</ViewItem> | ||
</GridCell> | ||
<ViewItem label={t("application.contact.state")}>{listing.buildingAddress.state}</ViewItem> | ||
<ViewItem label={t("application.contact.zip")}>{listing.buildingAddress.zipCode}</ViewItem> | ||
|
||
<GridCell span={2}> | ||
<ViewItem label={t("listings.yearBuilt")}>{listing.yearBuilt}</ViewItem> | ||
</GridCell> | ||
</GridSection> | ||
<GridSection columns={3}> | ||
<ViewItem label={t("listings.longitude")}>{listing.buildingAddress.longitude}</ViewItem> | ||
<ViewItem label={t("listings.latitude")}>{listing.buildingAddress.latitude}</ViewItem> | ||
</GridSection> | ||
</GridSection> | ||
) | ||
} | ||
|
||
export default DetailBuildingDetails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
sites/partners/src/listings/PaperListingDetails/sections/DetailListingIntro.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useContext } from "react" | ||
import { t, GridSection, ViewItem, GridCell } from "@bloom-housing/ui-components" | ||
import { ListingContext } from "../../ListingContext" | ||
|
||
const DetailListingIntro = () => { | ||
const listing = useContext(ListingContext) | ||
|
||
return ( | ||
<GridSection | ||
className="bg-primary-lighter" | ||
title={t("listings.sections.introTitle")} | ||
grid={false} | ||
inset | ||
> | ||
<GridSection columns={3}> | ||
<GridCell span={2}> | ||
<ViewItem label={t("listings.listingName")}>{listing.name}</ViewItem> | ||
</GridCell> | ||
<ViewItem label={t("listings.developer")}>{listing.developer}</ViewItem> | ||
</GridSection> | ||
</GridSection> | ||
) | ||
} | ||
|
||
export default DetailListingIntro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
sites/partners/src/listings/PaperListingForm/sections/BuildingDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import React from "react" | ||
import { useFormContext } from "react-hook-form" | ||
import { | ||
t, | ||
GridSection, | ||
GridCell, | ||
Field, | ||
ViewItem, | ||
Select, | ||
stateKeys, | ||
} from "@bloom-housing/ui-components" | ||
|
||
const BuildingDetails = () => { | ||
const formMethods = useFormContext() | ||
|
||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
const { register } = formMethods | ||
|
||
return ( | ||
<GridSection grid={false} columns={3} separator> | ||
<span className="form-section__title">{t("listings.sections.buildingDetailsTitle")}</span> | ||
<span className="form-section__description"> | ||
{t("listings.sections.buildingDetailsSubtitle")} | ||
</span> | ||
|
||
<GridSection columns={3}> | ||
<GridCell span={2}> | ||
<Field | ||
label={t("application.contact.streetAddress")} | ||
name={"buildingAddress.street"} | ||
id={"buildingAddress.street"} | ||
placeholder={t("application.contact.streetAddress")} | ||
register={register} | ||
/> | ||
</GridCell> | ||
<Field | ||
label={t("t.neighborhood")} | ||
name={"neighborhood"} | ||
id={"neighborhood"} | ||
placeholder={t("t.neighborhood")} | ||
register={register} | ||
/> | ||
</GridSection> | ||
<GridSection columns={6}> | ||
<GridCell span={2}> | ||
<Field | ||
label={t("application.contact.city")} | ||
name={"buildingAddress.city"} | ||
id={"buildingAddress.city"} | ||
placeholder={t("application.contact.city")} | ||
register={register} | ||
/> | ||
</GridCell> | ||
<ViewItem label={t("application.contact.state")} className="mb-0"> | ||
<Select | ||
id={`buildingAddress.state`} | ||
name={`buildingAddress.state`} | ||
label={t("application.contact.state")} | ||
labelClassName="sr-only" | ||
register={register} | ||
controlClassName="control" | ||
options={stateKeys} | ||
keyPrefix="states" | ||
errorMessage={t("errors.stateError")} | ||
/> | ||
</ViewItem> | ||
<Field | ||
label={t("application.contact.zip")} | ||
name={"buildingAddress.zipCode"} | ||
id={"buildingAddress.zipCode"} | ||
placeholder={t("application.contact.zip")} | ||
errorMessage={t("errors.zipCodeError")} | ||
register={register} | ||
/> | ||
<GridCell span={2}> | ||
<Field | ||
label={t("listings.yearBuilt")} | ||
name={"yearBuilt"} | ||
id={"yearBuilt"} | ||
placeholder={t("listings.yearBuilt")} | ||
type={"number"} | ||
register={register} | ||
/> | ||
</GridCell> | ||
</GridSection> | ||
<GridSection columns={3}> | ||
<Field | ||
label={t("listings.longitude")} | ||
name={"buildingAddress.longitude"} | ||
id={"buildingAddress.longitude"} | ||
placeholder={t("listings.longitude")} | ||
register={register} | ||
/> | ||
<Field | ||
label={t("listings.latitude")} | ||
name={"buildingAddress.latitude"} | ||
id={"buildingAddress.latitude"} | ||
placeholder={t("listings.latitude")} | ||
register={register} | ||
/> | ||
</GridSection> | ||
</GridSection> | ||
) | ||
} | ||
|
||
export default BuildingDetails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.