-
Notifications
You must be signed in to change notification settings - Fork 734
Infra/live code playground device wrapper #3298
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
Conversation
…code-add-more-components-2
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.
Please remove these changes of the icons 🙏
scripts/buildDocs.js
Outdated
const divTagIndex = processedSnippet.findIndex(line => | ||
line.trim().startsWith('return (') && processedSnippet[processedSnippet.indexOf(line) + 1]?.includes('<div>')); | ||
|
||
if (divTagIndex !== -1) { | ||
//If <div> tag is found, replace <div> and </div> with <MobileDeviceWrapper> and </MobileDeviceWrapper> | ||
return processedSnippet | ||
.map(line => line.replace('<div>', '<MobileDeviceWrapper>').replace('</div>', '</MobileDeviceWrapper>')) | ||
.join('\n'); | ||
} |
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.
This code has a few assumptions, hopefully they don't break; we can try to fins a better solution with a convention we can set.
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.
Let's sync about it.
Iv'e tried to implement it as HOC but I had some issues.
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.
This change breaks SortableGridList
[SimulatorTypes.TABLET]: {width: 900, height: 754} | ||
}; | ||
|
||
const simulatorOptions = [ |
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.
Should this be simulatorSegments
?
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.
Yes, changed.
style={styles.uilibLogo} | ||
/> | ||
<Text text60 marginV-s1> | ||
Wix React Native UILIB |
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.
Wix React Native UILIB | |
React Native UILIB |
</View> | ||
); | ||
|
||
const findSelectedIndex = () => simulatorOptions.findIndex(option => option.value === type); |
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.
How about getSelectedIndex
?
docuilib/yarn.lock
Outdated
@@ -6069,7 +6069,7 @@ lodash.uniq@^4.5.0: | |||
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" | |||
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== | |||
|
|||
lodash@^4.17.20, lodash@^4.17.21: | |||
lodash@4.x.x, lodash@^4.17.20, lodash@^4.17.21: |
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.
yarn.lock
should not change
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.
You are right I'm not sure about that checking it.
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.
I didn't managed to revert it, tried to checkout the commit and revert the file didn't managed to.
@M-i-k-e-l Alexey made some changes in the Design. |
Closing this PR, #3351 has new approach with iframe. |
Description
Docs playground (
live-code
) device wrapper to simulateMobile or Tablet
device.In the
buildDocs
script wrapping the component snippet with theMobileDeviceWrapper
that changes the size of theView
container according to the selected mode.Note: in
buildDocs
script there is a new functionprocessSnippet
that process the componentsnippet
, since now we have cases that the live-code playground render a function or plain JSX that should be wrapped with theMobileDeviceWrapper
.Based on #3272
Changelog
Docs playground (
live-code
) device wrapper to simulateMobile or Tablet
device.Additional info
MADS-4507