-
Notifications
You must be signed in to change notification settings - Fork 214
[Chakra v3 upgrade] @W-18672580 migrate offline components #2684
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
Changes from 3 commits
b656e9d
921af09
3bb0a95
3eee4df
3bf6378
45cfe62
73e901e
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 |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ import React from 'react' | |
| import {useIntl} from 'react-intl' | ||
|
|
||
| // Components | ||
| import {Alert, AlertDescription, Flex} from '@chakra-ui/react' | ||
|
Contributor
Author
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. In chakra v3, everything imported from Alert alone, AlertDescription is not needed anymore |
||
| import {Alert, Flex} from '@chakra-ui/react' | ||
|
|
||
| // Icons | ||
| import {AlertIcon} from '../../components/icons' | ||
|
|
@@ -20,17 +20,17 @@ import {AlertIcon} from '../../components/icons' | |
| const OfflineBanner = ({...props}) => { | ||
| const intl = useIntl() | ||
| return ( | ||
| <Alert status="warning" {...props}> | ||
| <Alert.Root status="warning" colorPalette="blue" {...props}> | ||
| <Flex align="center"> | ||
| <AlertIcon mr={2} /> | ||
| <AlertDescription> | ||
| <Alert.Title> | ||
| {intl.formatMessage({ | ||
| id: 'offline_banner.description.browsing_offline_mode', | ||
| defaultMessage: "You're currently browsing in offline mode" | ||
| })} | ||
| </AlertDescription> | ||
| </Alert.Title> | ||
| </Flex> | ||
| </Alert> | ||
| </Alert.Root> | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,23 +68,13 @@ class OfflineBoundary extends React.Component { | |
| return ( | ||
| <React.Fragment> | ||
|
Contributor
Author
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. Every component in offline-boundary is v3 compatible already. |
||
| {chunkLoadError ? ( | ||
| <div className="c-offline-boundary u-direction-column u-text-align-center u-padding-top u-padding-bottom"> | ||
| <div> | ||
| <AlertIcon /> | ||
|
|
||
| <h1 className="u-margin-bottom-md u-text-family"> | ||
| You are currently offline | ||
| </h1> | ||
|
|
||
| <p className="u-margin-bottom-lg"> | ||
| <h1>You are currently offline</h1> | ||
sf-jie-dai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <p> | ||
sf-jie-dai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {"We couldn't load the next page on this connection. Please try again."} | ||
| </p> | ||
|
|
||
| <Button | ||
| className="u-width-block-full pw--primary qa-retry-button" | ||
| onClick={() => this.clearError()} | ||
| > | ||
| Retry Connection | ||
| </Button> | ||
| <Button onClick={() => this.clearError()}>Retry Connection</Button> | ||
| </div> | ||
sf-jie-dai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) : ( | ||
| children | ||
|
|
||
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.
add unit test coverage report for
extension-chakra-storefrontfolder