-
Notifications
You must be signed in to change notification settings - Fork 30
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
docs: Add UNSAFE documentation to mobile Button and Text #2392
Changes from 8 commits
e9f4c63
171cb51
c975ab4
d463e1c
1c53299
4be4d1d
f57feaa
c17e5a6
b8ab074
5943103
a9f4ed4
f1c32aa
794c005
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -81,7 +81,7 @@ interface CommonButtonProps { | |||||
/** | ||||||
* **Use at your own risk:** Custom style for specific elements. This should only be used as a | ||||||
* **last resort**. Using this may result in unexpected side effects. | ||||||
* More information [here](https://atlantis.getjobber.com/storybook/?path=/docs/guides-customizing-components--docs#unsafe_-props). | ||||||
* More information in the Customizing components Guide. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. decided to do this instead of:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would still be valuable to add the link in case the doc is viewed in Storybook.
Suggested change
However, a more general question, should I be seeing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be visible only in "Mobile" tab? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup - since |
||||||
*/ | ||||||
readonly UNSAFE_style?: ButtonUnsafeStyle; | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ export interface PopoverProps { | |
/** | ||
* **Use at your own risk:** Custom class names for specific elements. This should only be used as a | ||
* **last resort**. Using this may result in unexpected side effects. | ||
* More information [here](https://atlantis.getjobber.com/storybook/?path=/docs/guides-customizing-components--docs#unsafe_-props). | ||
* More information in the Customizing components Guide. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line =). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done here 794c005 |
||
*/ | ||
readonly UNSAFE_className?: { | ||
container?: string; | ||
|
@@ -48,7 +48,7 @@ export interface PopoverProps { | |
/** | ||
* **Use at your own risk:** Custom style for specific elements. This should only be used as a | ||
* **last resort**. Using this may result in unexpected side effects. | ||
* More information [here](https://atlantis.getjobber.com/storybook/?path=/docs/guides-customizing-components--docs#unsafe_-props). | ||
* More information in the Customizing components Guide. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps, a link here and on line 40? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done here f1c32aa |
||
*/ | ||
readonly UNSAFE_style?: { | ||
container?: CSSProperties; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Component customization | ||
|
||
### UNSAFE\_ props (advanced usage) | ||
|
||
General information for using `UNSAFE_` props can be found | ||
[here](/guides/customizing-components). | ||
|
||
**Note**: Use of `UNSAFE_` props is **at your own risk** and should be | ||
considered a **last resort**. Future Button updates may lead to unintended | ||
taylorvnoj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
breakages. | ||
|
||
#### UNSAFE_style (mobile) | ||
|
||
The mobile Text component can be custom styled using the `textStyle` type via | ||
the `UNSAFE_style` prop. | ||
|
||
React Native does not support className. Instead, you can use `UNSAFE_style` to | ||
apply styles either inline or through a StyleSheet. | ||
|
||
##### Inline styles | ||
|
||
```tsx | ||
UNSAFE_style={{ textStyle: { color: tokens["color-purple--light"] } }} | ||
``` | ||
|
||
##### StyleSheet | ||
|
||
```tsx | ||
// Text.tsx | ||
UNSAFE_style={{ | ||
textStyle: styles.customTextStyle, | ||
}} | ||
|
||
// Text.style.ts | ||
export const styles = StyleSheet.create({ | ||
customTextStyle: { | ||
color: tokens["color-purple--light"], | ||
}, | ||
}); | ||
``` | ||
|
||
## Platform Considerations (Mobile) | ||
|
||
### Notes | ||
|
||
Text uses the core component [Text](https://reactnative.dev/docs/text) from | ||
`react-native`. | ||
|
||
### Copying text | ||
|
||
There are a few caveats around copying text on Android and iOS that you can read | ||
under the | ||
[Typography](../?path=/docs/components-text-and-typography-typography--docs#platform-considerations) | ||
documentation. |
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.
Now in
TextNotes.mdx