Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/javascript/packages/address-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { useDidUpdateEffect } from '@18f/identity-react-hooks';
import useUspsLocations from './hooks/use-usps-locations';
import type { AddressSearchProps } from './types';
import { snakeCase, formatLocations, transformKeys } from './utils';
import InPersonLocations from './components/in-person-locations';

export { snakeCase, formatLocations, transformKeys };
export { snakeCase, formatLocations, transformKeys, InPersonLocations };

function AddressSearch({
registerField = () => undefined,
Expand Down
19 changes: 19 additions & 0 deletions app/javascript/packages/address-search/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { RegisterFieldCallback } from '@18f/identity-form-steps';
import type { ReactNode } from 'react';

interface FormattedLocation {
formattedCityStateZip: string;
Expand Down Expand Up @@ -58,3 +59,21 @@ interface InPersonLocationsProps {
onSelect;
address: string;
}

interface LocationCollectionItemProps {
distance?: string;
formattedCityStateZip: string;
handleSelect?: (event: React.MouseEvent, selection: number) => void;
name?: string;
saturdayHours: string;
selectId: number;
streetAddress: string;
sundayHours: string;
weekdayHours: string;
}

interface LocationCollectionProps {
className?: string;

children?: ReactNode;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useState } from 'react';
import { Alert, PageHeading } from '@18f/identity-components';
import AddressSearchInput from '@18f/identity-address-search';
import type { LocationQuery } from '@18f/identity-address-search/types';
import AddressSearchInput, { InPersonLocations } from '@18f/identity-address-search';
import type { LocationQuery, FormattedLocation } from '@18f/identity-address-search/types';
import { useI18n } from '@18f/identity-react-i18n';
import InPersonLocations, { FormattedLocation } from './in-person-locations';

function AddressSearch({
registerField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { useI18n } from '@18f/identity-react-i18n';
import { Alert, PageHeading } from '@18f/identity-components';
import { request } from '@18f/identity-request';
import { forceRedirect } from '@18f/identity-url';
import { transformKeys, snakeCase } from '@18f/identity-address-search';
import type { LocationQuery } from '@18f/identity-address-search/types';
import { transformKeys, snakeCase, InPersonLocations } from '@18f/identity-address-search';
import type { LocationQuery, FormattedLocation } from '@18f/identity-address-search/types';
import FullAddressSearch from './in-person-full-address-search';
import BackButton from './back-button';
import AnalyticsContext from '../context/analytics';
import InPersonLocations, { FormattedLocation } from './in-person-locations';
import { InPersonContext } from '../context';
import UploadContext from '../context/upload';
import { LOCATIONS_URL } from './in-person-location-post-office-search-step';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useState, useEffect, useCallback, useRef, useContext } from 'react';
import { request } from '@18f/identity-request';
import { forceRedirect } from '@18f/identity-url';
import { transformKeys, snakeCase } from '@18f/identity-address-search';
import type { FormattedLocation } from '@18f/identity-address-search/types';
import BackButton from './back-button';
import AnalyticsContext from '../context/analytics';
import { FormattedLocation } from './in-person-locations';
import { InPersonContext } from '../context';
import UploadContext from '../context/upload';
import AddressSearch from './address-search';
Expand Down