forked from storybookjs/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixes storybookjs#253. Improve the message shown on the Controls…
… tab when the story has no controls configured.
- Loading branch information
1 parent
b195bb5
commit aa97ce1
Showing
2 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import styled from '@emotion/native'; | ||
import React from 'react'; | ||
import { Linking, View } from 'react-native'; | ||
|
||
const Paragraph = styled.Text(() => ({ | ||
marginBottom: 10, | ||
})); | ||
const LinkText = styled.Text(() => ({ | ||
color: 'blue', | ||
})); | ||
|
||
const NoControlsWarning = () => { | ||
return ( | ||
<View> | ||
<Paragraph>This story is not configured to handle controls.</Paragraph> | ||
<Paragraph> | ||
<LinkText | ||
onPress={() => Linking.openURL('https://storybook.js.org/docs/react/essentials/controls')} | ||
> | ||
Learn how to add controls | ||
</LinkText>{' '} | ||
and see{' '} | ||
<LinkText | ||
onPress={() => | ||
Linking.openURL( | ||
'https://github.com/storybookjs/react-native/tree/next-6.0/examples/native/components/ControlExamples' | ||
) | ||
} | ||
> | ||
examples in the Storybook React Native repository. | ||
</LinkText> | ||
</Paragraph> | ||
</View> | ||
); | ||
}; | ||
|
||
export default NoControlsWarning; |