File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed
src/sentry/static/sentry/app/components Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { withInfo } from '@storybook/addon-info' ;
3+
4+ import NotAvailable from 'app/components/notAvailable' ;
5+ import PanelTable from 'app/components/panels/panelTable' ;
6+
7+ export default {
8+ title : 'Core/NotAvailable' ,
9+ } ;
10+
11+ export const Default = withInfo (
12+ "When you don't have data to display, but don't want to display an empty space. It's commonly used in a table."
13+ ) ( ( ) => (
14+ < div >
15+ < div className = "section" >
16+ < h3 > Alone</ h3 >
17+ < NotAvailable />
18+ </ div >
19+ < div className = "section" >
20+ < h3 > In a Table</ h3 >
21+ < PanelTable headers = { [ 'Header #1' , 'Header #2' ] } >
22+ < div > Panel Item with really long content</ div >
23+ < div >
24+ < NotAvailable />
25+ </ div >
26+ </ PanelTable >
27+ </ div >
28+ </ div >
29+ ) ) ;
30+
31+ Default . story = {
32+ name : 'default' ,
33+ } ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import styled from '@emotion/styled' ;
3+
4+ function NotAvailable ( ) {
5+ return < Wrapper > { '\u2014' } </ Wrapper > ;
6+ }
7+
8+ const Wrapper = styled ( 'div' ) `
9+ color: ${ p => p . theme . gray200 } ;
10+ ` ;
11+
12+ export default NotAvailable ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ import { mountWithTheme } from 'sentry-test/enzyme' ;
4+
5+ import NotAvailable from 'app/components/notAvailable' ;
6+
7+ describe ( 'NotAvailable' , function ( ) {
8+ it ( 'renders' , function ( ) {
9+ const wrapper = mountWithTheme ( < NotAvailable /> ) ;
10+ expect ( wrapper . text ( ) ) . toEqual ( '\u2014' ) ;
11+ } ) ;
12+ } ) ;
You can’t perform that action at this time.
0 commit comments