Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(search): fixes search inputs being too small
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmeyer committed Mar 21, 2020
1 parent 338bc23 commit 5c67b72
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/__tests__/patients/view/ViewPatient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe('ViewPatient', () => {
setup()

const actualButtons: React.ReactNode[] = setButtonToolBarSpy.mock.calls[0][0]
console.log(actualButtons)
expect(actualButtons.length).toEqual(0)
})

Expand Down
31 changes: 18 additions & 13 deletions src/patients/appointments/AppointmentsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { useHistory } from 'react-router'
import { useTranslation } from 'react-i18next'
import { TextInput, Button, List, ListItem, Container, Row } from '@hospitalrun/components'
import { TextInput, Button, List, ListItem, Container, Row, Column } from '@hospitalrun/components'
import { RootState } from '../../store'
import { fetchPatientAppointments } from '../../scheduling/appointments/appointments-slice'
import useAddBreadcrumbs from '../../breadcrumbs/useAddBreadcrumbs'
Expand Down Expand Up @@ -54,18 +54,23 @@ const AppointmentsList = (props: Props) => {

return (
<Container>
<form className="form-inline" onSubmit={onSearchFormSubmit}>
<div className="input-group" style={{ width: '100%' }}>
<TextInput
size="lg"
value={searchText}
placeholder={t('actions.search')}
onChange={onSearchBoxChange}
/>
<div className="input-group-append">
<Button onClick={onSearchFormSubmit}>{t('actions.search')}</Button>
</div>
</div>
<form className="form" onSubmit={onSearchFormSubmit}>
<Row>
<Column md={10}>
<TextInput
size="lg"
type="text"
onChange={onSearchBoxChange}
value={searchText}
placeholder={t('actions.search')}
/>
</Column>
<Column md={2}>
<Button size="large" onClick={onSearchFormSubmit}>
{t('actions.search')}
</Button>
</Column>
</Row>
</form>

<Row>
Expand Down
40 changes: 27 additions & 13 deletions src/patients/list/Patients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import React, { useEffect, useState } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { useHistory } from 'react-router'
import { useTranslation } from 'react-i18next'
import { Spinner, TextInput, Button, List, ListItem, Container, Row } from '@hospitalrun/components'
import {
Spinner,
Button,
List,
ListItem,
Container,
Row,
TextInput,
Column,
} from '@hospitalrun/components'
import { useButtonToolbarSetter } from 'page-header/ButtonBarProvider'
import { RootState } from '../../store'
import { fetchPatients, searchPatients } from '../patients-slice'
Expand Down Expand Up @@ -67,18 +76,23 @@ const Patients = () => {

return (
<Container>
<form className="form-inline" onSubmit={onSearchFormSubmit}>
<div className="input-group" style={{ width: '100%' }}>
<TextInput
size="lg"
value={searchText}
placeholder={t('actions.search')}
onChange={onSearchBoxChange}
/>
<div className="input-group-append">
<Button onClick={onSearchFormSubmit}>{t('actions.search')}</Button>
</div>
</div>
<form className="form" onSubmit={onSearchFormSubmit}>
<Row>
<Column md={10}>
<TextInput
size="lg"
type="text"
onChange={onSearchBoxChange}
value={searchText}
placeholder={t('actions.search')}
/>
</Column>
<Column md={2}>
<Button size="large" onClick={onSearchFormSubmit}>
{t('actions.search')}
</Button>
</Column>
</Row>
</form>

<Row>
Expand Down

1 comment on commit 5c67b72

@vercel
Copy link

@vercel vercel bot commented on 5c67b72 Mar 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.