-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differentiate user being offline and API being offline #579
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Differentiate user being offline and API being offline |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { BuildBanner } from '../../components/BuildBanner' | |
import { useSearchQueryNetworkParam } from '../../hooks/useSearchQueryNetworkParam' | ||
import { ThemeByNetwork } from '../../components/ThemeByNetwork' | ||
import { NetworkOfflineBanner } from '../../components/OfflineBanner' | ||
import { useIsApiOffline } from '../../components/OfflineBanner/hook' | ||
import { useIsApiReachable } from '../../components/OfflineBanner/hook' | ||
|
||
export const zIndexHomePage = { | ||
paraTimeSelector: 1, | ||
|
@@ -112,7 +112,7 @@ export const HomePage: FC = () => { | |
const infoAriaLabel = t('home.helpScreen.infoIconAria') | ||
const { isMobile } = useScreenSize() | ||
const { network } = useSearchQueryNetworkParam() | ||
const isApiOffline = useIsApiOffline(network) | ||
const isApiReachable = useIsApiReachable(network) | ||
|
||
const [searchHasFocus, setSearchHasFocus] = useState(false) | ||
const [step, setStep] = useState<ParaTimeSelectorStep>(ParaTimeSelectorStep.EnableExplore) | ||
|
@@ -139,7 +139,7 @@ export const HomePage: FC = () => { | |
</LogotypeBox> | ||
<SearchInputContainer> | ||
<SearchInputBox> | ||
<Search disabled={isApiOffline} variant={searchVariant} onFocusChange={onFocusChange} /> | ||
<Search disabled={!isApiReachable} variant={searchVariant} onFocusChange={onFocusChange} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to update this to get the inside from within the structure returned by the hook. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😱 |
||
</SearchInputBox> | ||
</SearchInputContainer> | ||
<ThemeByNetwork network={network}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,7 @@ | |
}, | ||
"home": { | ||
"apiOffline": "Our {{ target }} API is offline. We’re trying to reconnect", | ||
"userOffline": "You are offline. We’re trying to reconnect", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"runtimeOutOfDate": "We don't have fully up-to-date data about our {{ target }}. The data displayed here might be out of date.", | ||
"runtimeOutOfDateSince": "The last update we have about our {{ target }} is from {{ lastUpdate }}. The data displayed here might be out of date.", | ||
"blocks": "Blocks", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer adding the full text of reason right inside the hook (we have access to translation there, too); no need to have a layer of compilation here...