Skip to content

Commit

Permalink
Feat: ORV2-1500 FE: Update Company Address Display (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikataot authored Jan 29, 2024
1 parent 008b125 commit 9be6d97
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
formatCellValuetoDatetime
} from "../../../../common/helpers/tableHelper";
import { CompanyProfile } from "../../../manageProfile/types/manageProfile";
import CountriesAndStates from "../../../../common/constants/countries_and_states.json";

/*
*
Expand Down Expand Up @@ -38,14 +39,20 @@ export const CompanySearchResultColumnDef: MRT_ColumnDef<CompanyProfile>[] = [
sortingFn: "alphanumeric",
Cell: (props: { row: any }) => {
const mailingAddress = props.row?.original?.mailingAddress
const country = mailingAddress?.countryCode === 'CA' ? 'Canada' : mailingAddress?.countryCode
const country = CountriesAndStates.filter((country) => {
return country?.code === mailingAddress?.countryCode
})

const province = country[0]?.states?.filter((state) => {
return state?.code === mailingAddress?.provinceCode
})

return (
<>
{mailingAddress?.addressLine1}<br />
{mailingAddress?.city}<br />
{mailingAddress?.provinceCode}<br />
{country} {mailingAddress?.postalCode}
{country[0]?.name}<br />
{province[0]?.name}<br />
{mailingAddress?.city} {mailingAddress?.postalCode}
</>
);
},
Expand Down

0 comments on commit 9be6d97

Please sign in to comment.