Skip to content

Commit

Permalink
Update Popup.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kamieniarz authored Mar 28, 2024
1 parent 389881b commit ba9d47f
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/features/scanner/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ConfigContext } from './ContextProvider'
* @param {{ children: React.ReactNode, mode: import('./hooks/store').ScanMode }} props
* @returns
*/
export function ScanNextOnDemandPopup({ children, mode }) {
export function ScanOnDemandPopup({ children, mode }) {
const { t } = useTranslation()
const context = React.useContext(ConfigContext)

Expand All @@ -30,31 +30,7 @@ export function ScanNextOnDemandPopup({ children, mode }) {
<List>
<StyledListItemText
className="no-leaflet-margin"
secondary={t('scan_next_choose')}
/>
<DividerWithMargin />
{context.scannerType !== 'mad' && children}
{context.showScanCount && <ScanRequests />}
{context.showScanQueue && <ScanQueue />}
<DividerWithMargin />
<ScanConfirm mode={mode} />
<InAllowedArea />
<ScanCancel mode={mode} />
</List>
</Popup>
)
}

export function ScanZoneOnDemandPopup({ children, mode }) {
const { t } = useTranslation()
const context = React.useContext(ConfigContext)

return (
<Popup minWidth={90} maxWidth={200} autoPan={false}>
<List>
<StyledListItemText
className="no-leaflet-margin"
secondary={t('scan_zone_choose')}
secondary={t(mode === 'scanZone' ? 'scan_zone_choose' : 'scan_next_choose')}
/>
<DividerWithMargin />
{context.scannerType !== 'mad' && children}
Expand Down

0 comments on commit ba9d47f

Please sign in to comment.