Browse Source

fix(storybook): Fix `<Pagination>` component (#33529)

Fixes the `<Pagination>` component inside of storybook.
Billy Vong 2 years ago
parent
commit
bbc7c37391
1 changed files with 4 additions and 20 deletions
  1. 4 20
      docs-ui/stories/components/pagination.stories.js

+ 4 - 20
docs-ui/stories/components/pagination.stories.js

@@ -1,6 +1,3 @@
-import {Component} from 'react';
-import PropTypes from 'prop-types';
-
 import Pagination from 'sentry/components/pagination';
 
 export default {
@@ -16,31 +13,18 @@ const withNext = `<https://sentry.io/api/0/organizations/sentry/issues/?cursor=1
 <https://sentry.io/api/0/organizations/sentry/issues/?cursor=1603719405000:0:0>; rel="next"; results="true"; cursor="1603719405000:0:0"
 `;
 
-class Container extends Component {
-  static childContextTypes = {
-    location: PropTypes.object,
-  };
-
-  getChildContext() {
-    return {location: window.location};
-  }
-  render() {
-    return this.props.children;
-  }
-}
-
 export const Default = () => {
   return (
-    <Container>
+    <div>
       <div className="section">
         <h3>Both enabled</h3>
-        <Pagination pageLinks={withBoth} />
+        <Pagination location={window.location} pageLinks={withBoth} />
       </div>
       <div className="section">
         <h3>Only next enabled</h3>
-        <Pagination pageLinks={withNext} />
+        <Pagination location={window.location} pageLinks={withNext} />
       </div>
-    </Container>
+    </div>
   );
 };