Browse Source

ref(js): Remove classic Context from Note story (#39647)

Evan Purkhiser 2 years ago
parent
commit
ff0f99ada5
1 changed files with 16 additions and 39 deletions
  1. 16 39
      docs-ui/stories/views/note.stories.js

+ 16 - 39
docs-ui/stories/views/note.stories.js

@@ -1,8 +1,7 @@
-import {Component, useState} from 'react';
+import {useState} from 'react';
 import {action} from '@storybook/addon-actions';
 
 import Note from 'sentry/components/activity/note';
-import SentryTypes from 'sentry/sentryTypes';
 import ConfigStore from 'sentry/stores/configStore';
 import MemberListStore from 'sentry/stores/memberListStore';
 import ProjectsStore from 'sentry/stores/projectsStore';
@@ -50,26 +49,6 @@ MemberListStore.loadInitialData([
   },
 ]);
 
-const organization = {
-  id: '1',
-  slug: 'org-slug',
-  access: ['project:releases'],
-};
-
-class OrganizationContext extends Component {
-  static childContextTypes = {
-    organization: SentryTypes.Organization,
-  };
-
-  getChildContext() {
-    return {organization};
-  }
-
-  render() {
-    return this.props.children;
-  }
-}
-
 export default {
   title: 'Views/Activity/Activity Note',
   component: Note,
@@ -79,23 +58,21 @@ export const Default = () => {
   const [text, setText] = useState(activity.data.text);
 
   return (
-    <OrganizationContext>
-      <Note
-        showTime
-        authorName={user.name}
-        user={user}
-        text={text}
-        modelId={activity.id}
-        dateCreated={activity.dateCreated}
-        projectSlugs={['project-slug']}
-        minHeight={200}
-        onUpdate={(...props) => {
-          action('Updated item', props);
-          setText(props[0].text);
-        }}
-        onDelete={action('Deleted item')}
-      />
-    </OrganizationContext>
+    <Note
+      showTime
+      authorName={user.name}
+      user={user}
+      text={text}
+      modelId={activity.id}
+      dateCreated={activity.dateCreated}
+      projectSlugs={['project-slug']}
+      minHeight={200}
+      onUpdate={(...props) => {
+        action('Updated item', props);
+        setText(props[0].text);
+      }}
+      onDelete={action('Deleted item')}
+    />
   );
 };