Skip to content

Commit

Permalink
Fix styles on the Search by name and address page according to the de…
Browse files Browse the repository at this point in the history
…sign (#471)

Fixed styles on the Search by name and address page according to the
design:
 - changed border color in Country Select from blue to purple
 - made border radius:0
 - fixed placeholder opacity
 - removed unnecessary changes and classes
  
<img width="400" alt="Screenshot 2024-12-30 at 15 04 50"
src="https://github.com/user-attachments/assets/f4cc7d7f-02fc-49ff-a8ea-84e732e35726"
/>
<img width="400" alt="Screenshot 2024-12-30 at 15 05 12"
src="https://github.com/user-attachments/assets/e9cf37db-2041-4cbb-a37d-33d5dcac72d7"
/>

---------

Co-authored-by: Inessa Druzhkova <[email protected]>
  • Loading branch information
Innavin369 and Inessa Druzhkova authored Dec 30, 2024
1 parent cdec06e commit d8bd12a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/react/src/components/Contribute/SearchByNameAndAddressTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Typography from '@material-ui/core/Typography';
import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';
import CircularProgress from '@material-ui/core/CircularProgress';
import StyledSelect from '../Filters/StyledSelect';

import COLOURS from '../../util/COLOURS';
import { makeSearchByNameAddressTabStyles } from '../../util/styles';

import { countryOptionsPropType } from '../../util/propTypes';
Expand All @@ -25,15 +25,23 @@ const InputHelperText = ({ classes }) => (
</span>
);

const defaultCountryOption = {
label: "What's the country?",
value: '',
};

const selectStyles = {
control: provided => ({
...provided,
height: '56px',
borderRadius: '0',
'&:focus,&:active,&:focus-within': {
borderColor: COLOURS.PURPLE,
boxShadow: `inset 0 0 0 1px ${COLOURS.PURPLE}`,
transition: 'box-shadow 0.2s',
},
'&:hover': {
borderColor: 'black',
},
}),
placeholder: provided => ({
...provided,
opacity: 0.7,
}),
};

Expand All @@ -46,7 +54,7 @@ const SearchByNameAndAddressTab = ({
}) => {
const [inputName, setInputName] = useState('');
const [inputAddress, setInputAddress] = useState('');
const [inputCountry, setInputCountry] = useState(defaultCountryOption);
const [inputCountry, setInputCountry] = useState(null);
const [nameTouched, setNameTouched] = useState(false);
const [addressTouched, setAddressTouched] = useState(false);

Expand All @@ -61,7 +69,7 @@ const SearchByNameAndAddressTab = ({
setInputAddress(event.target.value);
};
const handleCountryChange = event => {
setInputCountry(event || defaultCountryOption);
setInputCountry(event);
};

const handleSearch = () => {
Expand Down Expand Up @@ -163,9 +171,6 @@ const SearchByNameAndAddressTab = ({
}`,
notchedOutline: classes.notchedOutlineStyles,
},
inputProps: {
type: 'text',
},
}}
helperText={
addressTouched &&
Expand All @@ -186,7 +191,7 @@ const SearchByNameAndAddressTab = ({
options={countriesData || []}
value={inputCountry}
onChange={handleCountryChange}
className={`basic-multi-select notranslate ${classes.selectStyles}`}
className={classes.selectStyles}
styles={selectStyles}
placeholder="What's the country?"
isMulti={false}
Expand Down
2 changes: 2 additions & 0 deletions src/react/src/util/COLOURS.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ export default {
NAVIGATION: '#FCCF3F',
PALE_LIGHT_YELLOW: '#FFF2CE',
ACCENT_GREY: '#E7E8EA',

PURPLE: '#8428FA',
};

0 comments on commit d8bd12a

Please sign in to comment.