-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: snaps dynamic UI #12429
base: main
Are you sure you want to change the base?
feat: snaps dynamic UI #12429
Changes from all commits
1a12630
280b4a7
fc9b773
24f219e
6c7f28d
02f2054
f86e326
1426dc6
4bf801e
db88bb6
2786acd
8d20924
f0d31c4
351cebf
04876a5
34bed71
d8aea79
2f34a7d
0b14396
c141fb5
93a3d17
7bc4a32
a3d5413
b180225
683f4cd
956aac3
c5664c1
8666385
4fecdd1
41923b1
26476fb
dcd89af
29ea7f6
ef4832b
5da4e2e
e8bd935
c8f3a18
d7d00ad
d8e191c
5f42682
125e2da
53a16d9
cde7cee
59f2c7d
4a1d0fb
79d81bf
7d03e1b
f9665d3
82bbfd5
4c43ab0
ece756d
02e9381
d4bb190
8946c40
9313660
b4cee38
cb608e7
ea17669
e7b545e
e11a162
d5691e6
fb7769a
e02d763
1f7d313
2830669
e548a60
96e2b62
478cf3a
1b7d9a7
2302c37
2ea5db0
dbce24c
2097ad7
09d3ea4
590a82a
c522d51
a574fbd
ede58f0
9b3be41
f78b392
fc0fb8a
2ff8865
a79a624
221785e
3fe8fd9
67834d7
1b55d6c
9e9ea6c
8537e3c
33b9cb6
89e1765
7237a9a
b5a80d6
44451ab
f8f0b2f
32fb7dd
b5fef70
8fde153
c8fb01e
563dab4
58e7fe6
526fcc9
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 |
---|---|---|
|
@@ -23,6 +23,8 @@ const ButtonPrimary = ({ | |
onPressOut, | ||
isDanger = false, | ||
label, | ||
startIconName, | ||
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. As @brianacnguyen pointed out, what is the goal of this change? |
||
endIconName, | ||
...props | ||
}: ButtonPrimaryProps) => { | ||
const [pressed, setPressed] = useState(false); | ||
|
@@ -60,9 +62,9 @@ const ButtonPrimary = ({ | |
label | ||
); | ||
|
||
const renderLoading = () => ( | ||
<ActivityIndicator size="small" color={DEFAULT_BUTTONPRIMARY_LABEL_COLOR} /> | ||
); | ||
const renderLoading = () => ( | ||
<ActivityIndicator size="small" color={DEFAULT_BUTTONPRIMARY_LABEL_COLOR} /> | ||
); | ||
|
||
return ( | ||
<Button | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,19 +22,6 @@ exports[`ButtonPrimary render matches latest snapshot 1`] = ` | |
} | ||
} | ||
> | ||
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. There's a lot of changes in here like this that seem irrelevant |
||
<SvgMock | ||
color="#ffffff" | ||
height={16} | ||
name="Add" | ||
style={ | ||
{ | ||
"height": 16, | ||
"marginRight": 8, | ||
"width": 16, | ||
} | ||
} | ||
width={16} | ||
/> | ||
<Text | ||
accessibilityRole="text" | ||
style={ | ||
|
@@ -50,18 +37,5 @@ exports[`ButtonPrimary render matches latest snapshot 1`] = ` | |
> | ||
Sample label | ||
</Text> | ||
<SvgMock | ||
color="#ffffff" | ||
height={16} | ||
name="AddSquare" | ||
style={ | ||
{ | ||
"height": 16, | ||
"marginLeft": 8, | ||
"width": 16, | ||
} | ||
} | ||
width={16} | ||
/> | ||
</TouchableOpacity> | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { TextColor } from '../Texts/Text/Text.types'; | ||
import Text from '../Texts/Text'; | ||
import { Box } from '../../../components/UI/Box'; | ||
import { RowVariant } from '../../../components/Snaps/SnapUIRenderer/components/row'; | ||
import { AlignItems } from '../../../components/Snaps/SnapUIRenderer/components/box.types'; | ||
import { FlexDirection } from '../../../components/Snaps/SnapUIRenderer/components/box.types'; | ||
|
||
export type ConfirmInfoRowValueDoubleProps = { | ||
left: ReactNode; | ||
right: ReactNode; | ||
variant?: RowVariant; | ||
}; | ||
|
||
const LEFT_TEXT_COLORS = { | ||
[RowVariant.Default]: TextColor.Muted, | ||
[RowVariant.Critical]: TextColor.ErrorAlternative, | ||
[RowVariant.Warning]: TextColor.Warning, | ||
}; | ||
|
||
export const ConfirmInfoRowValueDouble = ({ | ||
left, | ||
right, | ||
variant = RowVariant.Default, | ||
}: ConfirmInfoRowValueDoubleProps) => { | ||
return ( | ||
<Box | ||
flexDirection={FlexDirection.Row} | ||
alignItems={AlignItems.center} | ||
gap={1} | ||
> | ||
{typeof left === 'string' ? ( | ||
<Text color={LEFT_TEXT_COLORS[variant] as TextColor}>{left}</Text> | ||
) : ( | ||
left | ||
)} | ||
{typeof right === 'string' ? ( | ||
<Text color={TextColor.Default}>{right}</Text> | ||
) : ( | ||
right | ||
)} | ||
</Box> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { StyleSheet } from 'react-native'; | ||
import { Theme } from '../../../util/theme/models'; | ||
import Device from '../../../util/device'; | ||
|
||
/** | ||
* | ||
* @param params Style sheet params. | ||
* @param params.theme App theme from ThemeContext. | ||
* @param params.vars Inputs that the style sheet depends on. | ||
* @returns StyleSheet object. | ||
*/ | ||
const styleSheet = (params: { theme: Theme }) => { | ||
const { theme } = params; | ||
const { colors } = theme; | ||
return StyleSheet.create({ | ||
root: { | ||
backgroundColor: colors.background.default, | ||
paddingTop: 24, | ||
paddingLeft: 16, | ||
paddingRight: 16, | ||
borderTopLeftRadius: 20, | ||
borderTopRightRadius: 20, | ||
minHeight: 200, | ||
paddingBottom: Device.isIphoneX() ? 20 : 0, | ||
}, | ||
actionContainer: { | ||
flex: 0, | ||
paddingVertical: 16, | ||
justifyContent: 'center', | ||
}, | ||
}); | ||
}; | ||
|
||
export default styleSheet; |
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.
We should not be modifying DS components to accept our props, that is what the mapping functions are for