Commit 7e0a630c authored by isstuev's avatar isstuev

fixes 4

parent 879161c1
......@@ -69,7 +69,7 @@ const LatestBlocks = () => {
}
if (isError) {
content = <Text>There are no blocks yet.</Text>;
content = <Text>No data. Please reload page.</Text>;
}
if (data) {
......
......@@ -34,7 +34,7 @@ const LatestTransactions = () => {
}
if (isError) {
content = <Text mt={ 4 }>There are no transactions. Please reload page.</Text>;
content = <Text mt={ 4 }>No data. Please reload page.</Text>;
}
if (data) {
......
......@@ -27,7 +27,7 @@ const Home = () => {
>
Welcome to Blockscout explorer
</Heading>
<LightMode><SearchBar backgroundColor="white" isHomepage/></LightMode>
<LightMode><SearchBar isHomepage/></LightMode>
</Box>
<Stats/>
<ChainIndicators/>
......
......@@ -8,12 +8,11 @@ import SearchBarMobile from './SearchBarMobile';
import SearchBarMobileHome from './SearchBarMobileHome';
type Props = {
backgroundColor?: string;
withShadow?: boolean;
isHomepage?: boolean;
}
const SearchBar = ({ backgroundColor, isHomepage, withShadow }: Props) => {
const SearchBar = ({ isHomepage, withShadow }: Props) => {
const [ value, setValue ] = React.useState('');
const handleChange = React.useCallback((event: ChangeEvent<HTMLInputElement>) => {
......@@ -28,7 +27,7 @@ const SearchBar = ({ backgroundColor, isHomepage, withShadow }: Props) => {
return (
<>
<SearchBarDesktop onChange={ handleChange } onSubmit={ handleSubmit } backgroundColor={ backgroundColor }/>
<SearchBarDesktop onChange={ handleChange } onSubmit={ handleSubmit } isHomepage={ isHomepage }/>
{ !isHomepage && (
<SearchBarMobile
onChange={ handleChange }
......@@ -40,7 +39,6 @@ const SearchBar = ({ backgroundColor, isHomepage, withShadow }: Props) => {
<SearchBarMobileHome
onChange={ handleChange }
onSubmit={ handleSubmit }
backgroundColor={ backgroundColor }
/>
) }
</>
......
......@@ -7,17 +7,17 @@ import searchIcon from 'icons/search.svg';
interface Props {
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
backgroundColor?: string;
isHomepage?: boolean;
}
const SearchBarDesktop = ({ onChange, onSubmit, backgroundColor }: Props) => {
const SearchBarDesktop = ({ onChange, onSubmit, isHomepage }: Props) => {
return (
<chakra.form
noValidate
onSubmit={ onSubmit }
display={{ base: 'none', lg: 'block' }}
w="100%"
bg={ backgroundColor }
backgroundColor={ isHomepage ? 'white' : 'none' }
borderRadius="10px"
>
<InputGroup>
......@@ -30,7 +30,9 @@ const SearchBarDesktop = ({ onChange, onSubmit, backgroundColor }: Props) => {
placeholder="Search by addresses / transactions / block / token... "
ml="1px"
onChange={ onChange }
border={ isHomepage ? 'none' : '2px solid' }
borderColor={ useColorModeValue('blackAlpha.100', 'whiteAlpha.200') }
color={ useColorModeValue('black', 'white') }
/>
</InputGroup>
</chakra.form>
......
......@@ -10,7 +10,7 @@ interface Props {
backgroundColor?: string;
}
const SearchBarMobileHome = ({ onChange, onSubmit, backgroundColor }: Props) => {
const SearchBarMobileHome = ({ onChange, onSubmit }: Props) => {
const commonProps = {
noValidate: true,
onSubmit: onSubmit,
......@@ -22,7 +22,7 @@ const SearchBarMobileHome = ({ onChange, onSubmit, backgroundColor }: Props) =>
<LightMode>
<chakra.form
{ ...commonProps }
bgColor={ backgroundColor }
bgColor="white"
h="60px"
borderRadius="10px"
>
......@@ -36,6 +36,7 @@ const SearchBarMobileHome = ({ onChange, onSubmit, backgroundColor }: Props) =>
ml="1px"
onChange={ onChange }
border="none"
color="black"
/>
</InputGroup>
</chakra.form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment