-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GenomeSelectorBySearchQuery (#1032)
- Disabled search field in GenomeSelectorBySearchQuery if the search brought results - Added content to show if there have been no search results - Added styles and behaviour to disabled ShadedInput component - Added a TextButton component, which uses native html button and thus is better for accessibility than spans or divs
- Loading branch information
Showing
14 changed files
with
323 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/content/app/new-species-selector/components/species-search-field/AddSpecies.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import ShadedInput from 'src/shared/components/input/ShadedInput'; | ||
import { PrimaryButton } from 'src/shared/components/button/Button'; | ||
import TextButton from 'src/shared/components/text-button/TextButton'; | ||
|
||
import styles from './SpeciesSearchField.scss'; | ||
|
||
export type Props = { | ||
query: string; | ||
canAdd: boolean; | ||
onAdd: () => void; | ||
onCancel: () => void; | ||
}; | ||
|
||
const AddSpecies = (props: Props) => { | ||
const { query, canAdd, onAdd, onCancel } = props; | ||
|
||
return ( | ||
<div className={styles.grid}> | ||
<label>Find a species</label> | ||
<ShadedInput | ||
size="large" | ||
className={styles.input} | ||
value={query} | ||
disabled={true} | ||
/> | ||
<div className={classNames(styles.controls, styles.addSpeciesControls)}> | ||
<PrimaryButton disabled={!canAdd} onClick={onAdd}> | ||
Add | ||
</PrimaryButton> | ||
<TextButton onClick={onCancel}>Cancel</TextButton> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AddSpecies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.