-
Notifications
You must be signed in to change notification settings - Fork 24
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
1349/leasing agent section, listings management #1376
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
40 changes: 40 additions & 0 deletions
40
sites/partners/src/listings/PaperListingDetails/sections/DetailLeasingAgent.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,40 @@ | ||
import React, { useContext } from "react" | ||
import { t, GridSection, ViewItem, GridCell } from "@bloom-housing/ui-components" | ||
import { ListingContext } from "../../ListingContext" | ||
|
||
const DetailLeasingAgent = () => { | ||
const listing = useContext(ListingContext) | ||
|
||
return ( | ||
<GridSection | ||
className="bg-primary-ligher" | ||
title={t("listings.sections.leasingAgentTitle")} | ||
grid={false} | ||
inset | ||
> | ||
<GridSection columns={3}> | ||
<GridCell> | ||
<ViewItem label={t("leasingAgent.name")}>{listing.leasingAgentName}</ViewItem> | ||
</GridCell> | ||
<GridCell> | ||
<ViewItem label={t("t.email")}>{listing.leasingAgentEmail}</ViewItem> | ||
</GridCell> | ||
<GridCell> | ||
<ViewItem label={t("t.phone")}>{listing.leasingAgentPhone}</ViewItem> | ||
</GridCell> | ||
</GridSection> | ||
<GridSection columns={2}> | ||
<GridCell> | ||
<ViewItem label={t("leasingAgent.title")}>{listing.leasingAgentTitle}</ViewItem> | ||
</GridCell> | ||
<GridCell> | ||
<ViewItem label={t("leasingAgent.officeHours")}> | ||
{listing.leasingAgentOfficeHours} | ||
</ViewItem> | ||
</GridCell> | ||
</GridSection> | ||
</GridSection> | ||
) | ||
} | ||
|
||
export default DetailLeasingAgent |
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
64 changes: 64 additions & 0 deletions
64
sites/partners/src/listings/PaperListingForm/sections/LeasingAgent.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,64 @@ | ||
import React from "react" | ||
import { useFormContext } from "react-hook-form" | ||
import { t, GridSection, Textarea, Field, PhoneField } from "@bloom-housing/ui-components" | ||
|
||
const LeasingAgent = () => { | ||
const formMethods = useFormContext() | ||
|
||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
const { register, control } = formMethods | ||
|
||
return ( | ||
<div> | ||
<GridSection grid={false} separator> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do something similar here to my comment on the detail pages for the detail forms too. |
||
<span className="form-section__title">{t("listings.sections.leasingAgentTitle")}</span> | ||
<span className="form-section__description"> | ||
{t("listings.sections.leasingAgentSubtitle")} | ||
</span> | ||
<GridSection columns={3}> | ||
<Field | ||
label={t("leasingAgent.name")} | ||
name={"leasingAgentName"} | ||
id={"leasingAgentName"} | ||
placeholder={t("leasingAgent.namePlaceholder")} | ||
register={register} | ||
/> | ||
<Field | ||
label={t("t.email")} | ||
name={"leasingAgentEmail"} | ||
id={"leasingAgentEmail"} | ||
placeholder={t("t.emailAddressPlaceholder")} | ||
register={register} | ||
/> | ||
<PhoneField | ||
label={t("t.phone")} | ||
name={"leasingAgentPhone"} | ||
id={"leasingAgentPhone"} | ||
placeholder={t("t.phoneNumberPlaceholder")} | ||
control={control} | ||
controlClassName={"control"} | ||
/> | ||
</GridSection> | ||
<GridSection columns={2}> | ||
<Field | ||
label={t("leasingAgent.title")} | ||
name={"leasingAgentTitle"} | ||
id={"leasingAgentTitle"} | ||
placeholder={t("leasingAgent.title")} | ||
register={register} | ||
/> | ||
<Textarea | ||
label={t("leasingAgent.officeHours")} | ||
name={"leasingAgentOfficeHours"} | ||
id={"leasingAgentOfficeHours"} | ||
fullWidth={true} | ||
placeholder={t("leasingAgent.officeHoursPlaceholder")} | ||
register={register} | ||
/> | ||
</GridSection> | ||
</GridSection> | ||
</div> | ||
) | ||
} | ||
|
||
export default LeasingAgent |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just something for us to think about. It's looking like we might benefit from a component that could make these go a little faster. It could take something like
{ columns: number, fields: { label: string, value: T }[] }[]