-
Notifications
You must be signed in to change notification settings - Fork 734
Typescript/state screen #1455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Typescript/state screen #1455
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
22b23a8
index.js -> index.tsx
mendyEdri 391a1fd
migrate StateScreen to typecript
mendyEdri d019e86
added fake type for docs
mendyEdri d40a1af
EmptyStateScreen.js -> EmptyStateScreen.tsx
mendyEdri bfa09c6
EmptyStateScreen migration to ts
mendyEdri 6d09afb
Support nested text
mendyEdri 61becc1
optional style support
mendyEdri e2f8d51
Fix styles
mendyEdri c0255d1
declerations
mendyEdri 265259d
fix export
mendyEdri e568810
types should be tsx and not ts (for docs)
mendyEdri 99ea95f
PR comments
mendyEdri a5ec6a1
export also in generatedTypes + remove manual typings
mendyEdri 37358f8
Uses different image that's working
mendyEdri 8365a1c
Merge branch 'master' into typescript/state-screen
mendyEdri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,7 @@ | ||
import React from 'react'; | ||
import { StateScreenProps } from './types'; | ||
export { StateScreenProps }; | ||
declare const _default: React.ComponentClass<StateScreenProps & { | ||
useCustomTheme?: boolean | undefined; | ||
}, any>; | ||
export default _default; |
This file contains hidden or 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,30 @@ | ||
/// <reference types="react" /> | ||
import { ImageURISource } from 'react-native'; | ||
export declare type StateScreenProps = { | ||
/** | ||
* The image source that's showing at the top. use an image that was required locally | ||
*/ | ||
imageSource?: ImageURISource; | ||
source?: ImageURISource; | ||
/** | ||
* To to show as the title | ||
*/ | ||
title: string; | ||
/** | ||
* Text to to show as the subtitle | ||
*/ | ||
subtitle?: string | React.ReactNode; | ||
/** | ||
* Text to to show in the "call to action" button | ||
*/ | ||
ctaLabel?: string; | ||
/** | ||
* Action handler for "call to action" button | ||
*/ | ||
onCtaPress?: () => void; | ||
/** | ||
* Use to identify the container in tests | ||
*/ | ||
testId?: string; | ||
testID?: string; | ||
}; |
This file contains hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
import {PureComponent} from 'react'; | ||
import {ImageURISource} from 'react-native'; | ||
|
||
export type StateScreenProps = { | ||
/** | ||
* The image source that's showing at the top. use an image that was required locally | ||
*/ | ||
imageSource?: ImageURISource; | ||
source?: ImageURISource; // TODO: remove after deprecation | ||
/** | ||
* To to show as the title | ||
*/ | ||
title: string; | ||
/** | ||
* Text to to show as the subtitle | ||
*/ | ||
subtitle?: string | React.ReactNode; | ||
/** | ||
* Text to to show in the "call to action" button | ||
*/ | ||
ctaLabel?: string; | ||
/** | ||
* Action handler for "call to action" button | ||
*/ | ||
onCtaPress?: () => void; | ||
/** | ||
* Use to identify the container in tests | ||
*/ | ||
testId?: string; | ||
testID?: string; | ||
}; | ||
|
||
/** | ||
* @description: Component that shows a full screen for a certain state, like an empty state | ||
* @image: https://user-images.githubusercontent.com/33805983/34672894-f262ab84-f488-11e7-83f0-4ee0f0ac34ba.png | ||
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/EmptyStateScreen.tsx | ||
*/ | ||
// @ts-ignore | ||
class FakeStateScreenForDocs extends PureComponent<StateScreenProps> { // eslint-disable-line | ||
static displayName = 'StateScreen'; | ||
|
||
render() { | ||
return null; | ||
} | ||
} |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's the props 🤦♂️