@arcblock/ux 2.2.4 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/lib/ActivityIndicator/index.js +7 -9
  2. package/lib/Alert/index.js +6 -5
  3. package/lib/AnimationWaiter/index.js +6 -5
  4. package/lib/Badge/index.js +6 -5
  5. package/lib/Blocklet/blocklet.js +6 -5
  6. package/lib/Blocklet/utils.js +6 -5
  7. package/lib/BlockletNFT/index.js +6 -5
  8. package/lib/Center/index.js +6 -5
  9. package/lib/ClickToCopy/index.js +6 -5
  10. package/lib/CodeBlock/index.js +6 -5
  11. package/lib/ContactForm/index.js +6 -5
  12. package/lib/CookieConsent/index.js +6 -5
  13. package/lib/CountDown/index.js +6 -5
  14. package/lib/Datatable/CustomToolbar.js +7 -9
  15. package/lib/Datatable/DatatableContext.js +2 -2
  16. package/lib/Datatable/TableSearch.js +6 -5
  17. package/lib/Datatable/index.js +12 -15
  18. package/lib/Dialog/dialog.js +8 -10
  19. package/lib/Earth/index.js +7 -9
  20. package/lib/Empty/index.js +6 -5
  21. package/lib/ErrorBoundary/fallback.js +6 -5
  22. package/lib/Footer/index.js +6 -6
  23. package/lib/Header/auto-hidden.js +6 -5
  24. package/lib/Header/header.js +6 -5
  25. package/lib/Header/responsive-header.js +7 -9
  26. package/lib/Icon/image.js +6 -5
  27. package/lib/Icon/index.js +6 -5
  28. package/lib/InfoRow/index.js +6 -5
  29. package/lib/Layout/dashboard/index.js +12 -18
  30. package/lib/Layout/dashboard/sidebar.js +15 -10
  31. package/lib/Layout/dashboard-legacy/header.js +6 -5
  32. package/lib/Layout/dashboard-legacy/index.js +6 -5
  33. package/lib/Layout/dashboard-legacy/sidebar.js +10 -17
  34. package/lib/Layout/index.js +7 -9
  35. package/lib/Locale/selector.js +6 -5
  36. package/lib/Logo/index.js +6 -5
  37. package/lib/Metric/index.js +6 -6
  38. package/lib/NFTDisplay/aspect-ratio-container.js +6 -5
  39. package/lib/NFTDisplay/broken.js +6 -5
  40. package/lib/NFTDisplay/index.js +6 -5
  41. package/lib/NFTDisplay/loading.js +6 -5
  42. package/lib/NFTDisplay/svg-embedder/inline-svg.js +9 -11
  43. package/lib/NavMenu/style.js +8 -13
  44. package/lib/PricingTable/PricingPlan.js +6 -5
  45. package/lib/PricingTable/index.js +6 -5
  46. package/lib/Result/result.js +6 -5
  47. package/lib/Screenshot/index.js +6 -5
  48. package/lib/SplitButton/index.js +7 -9
  49. package/lib/Tag/index.js +6 -5
  50. package/lib/TextCollapse/index.js +6 -5
  51. package/lib/Theme/theme-provider.js +9 -7
  52. package/lib/Video/index.js +6 -5
  53. package/lib/Wallet/Action.js +6 -5
  54. package/lib/Wallet/Download.js +6 -5
  55. package/lib/Wallet/Open.js +6 -5
  56. package/lib/WechatPrompt/index.js +6 -5
  57. package/lib/withTheme/index.js +9 -5
  58. package/lib/withTracker/index.js +19 -34
  59. package/package.json +6 -8
  60. package/src/ActivityIndicator/index.js +1 -1
  61. package/src/Alert/index.js +1 -1
  62. package/src/AnimationWaiter/index.js +1 -1
  63. package/src/Badge/index.js +1 -1
  64. package/src/Blocklet/blocklet.js +1 -1
  65. package/src/Blocklet/utils.js +1 -1
  66. package/src/BlockletNFT/index.js +1 -1
  67. package/src/Center/index.js +1 -1
  68. package/src/ClickToCopy/index.js +1 -1
  69. package/src/CodeBlock/index.js +1 -1
  70. package/src/ContactForm/index.js +1 -1
  71. package/src/CookieConsent/index.js +1 -1
  72. package/src/CountDown/index.js +1 -1
  73. package/src/Datatable/CustomToolbar.js +1 -1
  74. package/src/Datatable/DatatableContext.js +2 -2
  75. package/src/Datatable/TableSearch.js +1 -1
  76. package/src/Datatable/index.js +5 -4
  77. package/src/Dialog/dialog.js +1 -1
  78. package/src/Earth/index.js +1 -1
  79. package/src/Empty/index.js +1 -1
  80. package/src/ErrorBoundary/fallback.js +1 -1
  81. package/src/Footer/index.js +1 -1
  82. package/src/Header/auto-hidden.js +1 -1
  83. package/src/Header/header.js +1 -1
  84. package/src/Header/responsive-header.js +1 -1
  85. package/src/Icon/image.js +1 -1
  86. package/src/Icon/index.js +1 -1
  87. package/src/InfoRow/index.js +1 -1
  88. package/src/Layout/dashboard/index.js +4 -6
  89. package/src/Layout/dashboard/sidebar.js +4 -3
  90. package/src/Layout/dashboard-legacy/header.js +1 -1
  91. package/src/Layout/dashboard-legacy/index.js +1 -1
  92. package/src/Layout/dashboard-legacy/sidebar.js +4 -6
  93. package/src/Layout/index.js +1 -1
  94. package/src/Locale/selector.js +1 -1
  95. package/src/Logo/index.js +1 -1
  96. package/src/Metric/index.js +1 -1
  97. package/src/NFTDisplay/aspect-ratio-container.js +1 -1
  98. package/src/NFTDisplay/broken.js +1 -1
  99. package/src/NFTDisplay/index.js +1 -1
  100. package/src/NFTDisplay/loading.js +1 -1
  101. package/src/NFTDisplay/svg-embedder/inline-svg.js +2 -2
  102. package/src/NavMenu/style.js +1 -1
  103. package/src/PricingTable/PricingPlan.js +1 -1
  104. package/src/PricingTable/index.js +1 -1
  105. package/src/Result/result.js +1 -1
  106. package/src/Screenshot/index.js +1 -1
  107. package/src/SplitButton/index.js +1 -1
  108. package/src/Tag/index.js +1 -1
  109. package/src/TextCollapse/index.js +1 -1
  110. package/src/Theme/theme-provider.js +7 -6
  111. package/src/Video/index.js +1 -1
  112. package/src/Wallet/Action.js +1 -1
  113. package/src/Wallet/Download.js +1 -1
  114. package/src/Wallet/Open.js +1 -1
  115. package/src/WechatPrompt/index.js +1 -1
  116. package/src/withTheme/index.js +6 -4
  117. package/src/withTracker/index.js +20 -33
@@ -1,15 +1,17 @@
1
1
  import * as React from 'react';
2
- import { ThemeProvider, createGlobalStyle } from 'styled-components';
2
+ import { Global, ThemeProvider, css } from '@emotion/react';
3
3
  import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
4
4
  import CssBaseline from '@mui/material/CssBaseline';
5
5
 
6
6
  import { create } from '../Theme';
7
7
 
8
- const GlobalStyle = createGlobalStyle`
8
+ const globalStyles = css`
9
9
  font-family: ${(props) => props.theme.typography.fontFamily};
10
10
  color: ${(props) => props.theme.typography.color.main};
11
11
 
12
- a, a:hover, a:active {
12
+ a,
13
+ a:hover,
14
+ a:active {
13
15
  text-decoration: none;
14
16
  color: ${(props) => props.theme.palette.primary.dark};
15
17
  }
@@ -57,7 +59,7 @@ function withTheme(Component, { mode = 'light', pageWidth = 'md', palette, typog
57
59
  return (
58
60
  <MuiThemeProvider theme={this.theme}>
59
61
  <CssBaseline />
60
- <GlobalStyle theme={this.theme} />
62
+ <Global styles={globalStyles} />
61
63
  <ThemeProvider theme={this.theme}>
62
64
  <Component {...this.props} />
63
65
  </ThemeProvider>
@@ -1,11 +1,10 @@
1
- /* eslint-disable react/no-deprecated */
2
- /* eslint-disable react/static-property-placement */
3
1
  /* eslint-disable import/no-unresolved */
4
- import { Component } from 'react';
5
- import PropTypes from 'prop-types';
6
2
  import ReactGA from 'react-ga';
7
3
  import * as Sentry from '@sentry/browser';
8
- import { withRouter } from 'react-router-dom';
4
+
5
+ import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect';
6
+ import useMount from 'react-use/lib/useMount';
7
+ import { useLocation } from 'react-router-dom';
9
8
 
10
9
  import ErrorBoundary from './error_boundary';
11
10
 
@@ -34,37 +33,25 @@ export default (WrappedComponent, options = {}) => {
34
33
  }
35
34
  };
36
35
 
37
- class TrackedComponent extends Component {
38
- static propTypes = {
39
- location: PropTypes.object.isRequired,
40
- };
41
-
42
- componentDidMount() {
43
- const page = this.props.location.pathname;
44
- trackPage(page);
45
- }
46
-
47
- componentWillReceiveProps(nextProps) {
48
- const currentPage = this.props.location.pathname;
49
- const nextPage = nextProps.location.pathname;
36
+ return function TrackedComponent(props) {
37
+ const location = useLocation();
50
38
 
51
- if (currentPage !== nextPage) {
52
- trackPage(nextPage);
53
- }
54
- }
39
+ useMount(() => {
40
+ trackPage(location.pathname);
41
+ });
55
42
 
56
- render() {
57
- if (process.env.NODE_ENV === 'production') {
58
- return (
59
- <ErrorBoundary>
60
- <WrappedComponent {...this.props} />
61
- </ErrorBoundary>
62
- );
63
- }
43
+ useDeepCompareEffect(() => {
44
+ trackPage(location.pathname);
45
+ }, [location.pathname]);
64
46
 
65
- return <WrappedComponent {...this.props} />;
47
+ if (process.env.NODE_ENV === 'production') {
48
+ return (
49
+ <ErrorBoundary>
50
+ <WrappedComponent {...props} />
51
+ </ErrorBoundary>
52
+ );
66
53
  }
67
- }
68
54
 
69
- return withRouter(TrackedComponent);
55
+ return <WrappedComponent {...props} />;
56
+ };
70
57
  };