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
4 changes: 2 additions & 2 deletions packages/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jmstechnologiesinc/react-native-components",
"version": "0.5.5",
"version": "0.5.4",
"description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.",
"author": "yerloveraaa <yerloveraaa@gmail.com>",
"homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme",
Expand Down
14 changes: 0 additions & 14 deletions packages/components/src/Form/Form.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,6 @@ export const BusinessInfoHighlighted = () => (
/>
);

// The store sign-up's form: the app asks the address with Google's suggestions, so the form leaves its field out, as
// it leaves out the phone and the email.
export const BusinessInfoWithoutLocation = () => (
<AuthForm.BusinessInfo
storeTitle={state.storeTitle}
location={state.storeAddress}
industries={[]}
showLocation={false}
showPhoneNumber={false}
showEmail={false}
inputActionHandler={() => {}}
/>
);

// The driver's answers as a reviewer sees them: read-only (no disclosure, the
// secrets masked), a changed field marked and a server error under its field.
export const DriverInfoReadOnly = () => (
Expand Down
33 changes: 14 additions & 19 deletions packages/components/src/Form/FormBusinessInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ const FormBusinessInfo = ({
storeTitle,
location,
line2,
// A host that asks the store address with its own input (the app's Google suggestions, barrel only) hides this
// field, as the sign-up hides the phone and the email.
showLocation = true,
showWebsite = true,
showPhoneNumber = true,
showEmail = true,
Expand Down Expand Up @@ -141,22 +138,20 @@ const FormBusinessInfo = ({
onChangeText={(text) => inputActionHandler('description', text)}
/>
</ScreenWrapper.Section>
{showLocation ? (
<ScreenWrapper.Section>
<FormField
mode="outlined"
field="location"
errors={errors}
highlighted={isHighlighted(highlightFields, 'location')}
disabled={disabled}
readOnly={readOnly}
label={localized('storeAddress')}
value={location}
autoCapitalize="words"
onChangeText={(text) => inputActionHandler('location', text)}
/>
</ScreenWrapper.Section>
) : null}
<ScreenWrapper.Section>
<FormField
mode="outlined"
field="location"
errors={errors}
highlighted={isHighlighted(highlightFields, 'location')}
disabled={disabled}
readOnly={readOnly}
label={localized('storeAddress')}
value={location}
autoCapitalize="words"
onChangeText={(text) => inputActionHandler('location', text)}
/>
</ScreenWrapper.Section>
<ScreenWrapper.Section>
<FormField
mode="outlined"
Expand Down
16 changes: 0 additions & 16 deletions packages/components/src/Form/__tests__/Form.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,6 @@ describe('Form.BusinessInfo', () => {
expect(hidden.root.findAll((node) => node.props.value === 'Casa Nostra LLC')).toHaveLength(0);
});

// The app asks the store address with Google's suggestions (barrel only) and hides this field, as it hides the
// phone and the email; the field's own errors are then the host's to show.
it('hides the store address under showLocation={false}, and keeps the other fields', () => {
const hidden = render(
<Form.BusinessInfo
{...BUSINESS}
showLocation={false}
errors={[{ field: 'location', code: 'operating_address_not_located' }]}
/>
);
expect(inputWithValue(hidden, '1 Main St')).toBeUndefined();
expect(hostOf(hidden, 'error.location')).toHaveLength(0);
expect(inputWithValue(hidden, 'Suite 2')).toBeDefined();
expect(inputWithValue(render(<Form.BusinessInfo {...BUSINESS} />), '1 Main St')).toBeDefined();
});

it('names the tax id on file (masked) instead of showing it', () => {
const tree = render(<Form.BusinessInfo {...BUSINESS} tin="" tinOnFile="•••••6789" />);
expect(JSON.stringify(tree.toJSON())).toContain('•••••6789');
Expand Down
Loading