Skip to content

Commit

Permalink
fix: more appropriate buttons and names for result state
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Jun 5, 2023
1 parent 0e35873 commit a57d328
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions src/components/search-wizard/Wizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,42 @@ export default function SearchWizard() {
{state.matches('error') ? (
<p>{JSON.stringify(state.context.error, null, 2)}</p>
) : null}
<div className="justify-self-end border-t border-t-slate-300 p-2">
<Button
appearance={Button.Appearances.solid}
color={Button.Colors.primary}
className="w-full"
size={Button.Sizes.xl}
busy={state.matches('searching')}
disabled={state.context.searchLayers.length === 0}
onClick={() => send('SEARCH')}
>
Search{' '}
{state.context.searchLayers.length
? `${state.context.searchLayers.length} Layer${
state.context.searchLayers.length > 1 ? 's' : ''
}`
: null}
</Button>
<div className="space-y-2 justify-self-end border-t border-t-slate-300 p-2">
{state.matches('result') ? (
<Button
color={Button.Colors.primary}
className="w-full"
size={Button.Sizes.xl}
onClick={() => send('QUERY_LAYERS')}
>
Back
</Button>
) : (
<Button
appearance={Button.Appearances.solid}
color={Button.Colors.primary}
className="w-full"
size={Button.Sizes.xl}
busy={state.matches('searching')}
disabled={state.context.searchLayers.length === 0}
onClick={() => send('SEARCH')}
>
Search{' '}
{state.context.searchLayers.length
? `${state.context.searchLayers.length} Layer${
state.context.searchLayers.length > 1 ? 's' : ''
}`
: null}
</Button>
)}
<Button
color={Button.Colors.accent}
className="mt-2 w-full"
className="w-full"
size={Button.Sizes.xl}
onClick={() => send('CLEAR')}
disabled={state.matches('searching')}
>
Clear
{state.matches('result') ? 'Start New Search' : 'Clear'}
</Button>
</div>
</div>
Expand Down

0 comments on commit a57d328

Please sign in to comment.