-
Notifications
You must be signed in to change notification settings - Fork 734
Live Code - support more components 2 #3272
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
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a81b463
Support live code for components
M-i-k-e-l ef6563e
Add ActionBar
M-i-k-e-l 9ff281e
Add Checkbox
M-i-k-e-l df6576b
Add Chip
M-i-k-e-l 848bf96
Add RadioButton
M-i-k-e-l 6b92c29
Add RadioGroup
M-i-k-e-l 855ec96
Remove (regular) Slider
M-i-k-e-l 662ee98
Add Switch
M-i-k-e-l f4097f8
Add Incubator.Slider (add incubator package)
M-i-k-e-l 2516613
Add SortableList and Icon (add assets package and add a couple of ass…
M-i-k-e-l 75eebd0
Merge branch 'master' into infra/live-code-add-more-components-1
M-i-k-e-l d5890f0
Merge branch 'infra/live-code-add-more-components-1' into infra/live-…
M-i-k-e-l dca31c1
Add flexMigration to SortableList
M-i-k-e-l 6def866
Add SortableGridList and Card (add Assets.data.products)
M-i-k-e-l 614b937
Add MaskedInput
M-i-k-e-l 7c07714
Add Carousel
M-i-k-e-l 454cfbf
Add Drawer
M-i-k-e-l 5268e7f
Add usesAnimated to the API
M-i-k-e-l bb4e4ee
Merge branch 'master' into infra/live-code-add-more-components-2
M-i-k-e-l 33ee7f8
Fix assets (and relevant examples)
M-i-k-e-l 6497c43
Fix some review notes
M-i-k-e-l 5278f72
Merge branch 'master' into infra/live-code-add-more-components-2
M-i-k-e-l 2f7617f
Merge branch 'master' into infra/live-code-add-more-components-2
M-i-k-e-l 1f6b492
Remove usesAnimated and drawer's snippet
M-i-k-e-l a8600f5
Move to Data and Playground
M-i-k-e-l 43394f1
Add Icon configuration
M-i-k-e-l bc2a7b2
Fix chevronRight size
M-i-k-e-l 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
const products = [ | ||
{ | ||
id: 'a', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 1 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/248412/pexels-photo-248412.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200' | ||
}, | ||
{ | ||
id: 'b', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 2 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/3737604/pexels-photo-3737604.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200' | ||
}, | ||
{ | ||
id: 'c', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 1 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/3685538/pexels-photo-3685538.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200' | ||
}, | ||
{ | ||
id: 'd', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'Out of Stock', | ||
quantity: 0 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/4202467/pexels-photo-4202467.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200' | ||
}, | ||
{ | ||
id: 'e', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 3 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_f9de629d8c97416f82b398725bd49918.jpg_128' | ||
}, | ||
{ | ||
id: 'f', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'statu', | ||
status: 'Out of Stock', | ||
quantity: 0 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_1782572f1dfc49d397e830918d912568.jpg_128' | ||
}, | ||
{ | ||
id: 'g', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 10 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_03906910d07749199b09e443ce9fed6c.jpg_128' | ||
}, | ||
{ | ||
id: 'h', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 11 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_9d3e5b8fc70e4d2997806ece35e7de54.jpg_128' | ||
}, | ||
{ | ||
id: 'i', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 10 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_db24e0568cdc4a82be0a8559fb123b55.jpg_128' | ||
}, | ||
{ | ||
id: 'j', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 2 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_085a5f9575ba4b208f6091b26cbda4c4.jpg_128' | ||
}, | ||
{ | ||
id: 'k', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 8 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/cda177_82d66fece3e54a7aa10d49bda4d98259.jpg_128' | ||
}, | ||
{ | ||
id: 'l', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 8 | ||
}, | ||
mediaUrl: 'https://static.wixstatic.com/media/84770f_c611ded729fd4461a1bb57134d4e9dd2.png_128' | ||
}, | ||
{ | ||
id: 'm', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 3 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/3612182/pexels-photo-3612182.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150' | ||
}, | ||
{ | ||
id: 'n', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 22 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/4841529/pexels-photo-4841529.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150' | ||
}, | ||
{ | ||
id: 'o', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 10 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/4173450/pexels-photo-4173450.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150' | ||
}, | ||
{ | ||
id: 'p', | ||
name: 'I\'m a Product', | ||
formattedPrice: '$19.99', | ||
inventory: { | ||
trackingMethod: 'status', | ||
status: 'In Stock', | ||
quantity: 10 | ||
}, | ||
mediaUrl: 'https://images.pexels.com/photos/10513273/pexels-photo-10513273.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=150' | ||
} | ||
]; | ||
|
||
export default products; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
import React from 'react'; | ||
import {Text, View} from 'react-native-ui-lib/core'; | ||
import Switch from 'react-native-ui-lib/switch'; | ||
|
||
interface ControlBaseProps<S> { | ||
state: S; | ||
setState: React.Dispatch<React.SetStateAction<S>>; | ||
} | ||
|
||
interface ToggleControlProps extends ControlBaseProps<boolean> { | ||
title: string; | ||
key?: string; | ||
spread?: boolean; | ||
} | ||
|
||
export function ToggleControl(props: ToggleControlProps) { | ||
const {state, setState, title, spread = false, key = 'does not change'} = props; | ||
return ( | ||
<View row centerV spread={spread} marginB-s4 key={key}> | ||
<Text $textDefault flex={spread} marginR-s4={!spread}> | ||
{title} | ||
</Text> | ||
<Switch key={key} testID={key} value={state} onValueChange={setState}/> | ||
</View> | ||
); | ||
} |
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,6 @@ | ||
import {ThemeManager} from 'react-native-ui-lib/core'; | ||
|
||
ThemeManager.setComponentForcedTheme('Icon', props => { | ||
const {source} = props; | ||
return source?.source ? source : undefined; | ||
}); |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.