Skip to content
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

Approve design updates #1455

Merged
merged 21 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions app/components/Nav/App/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ exports[`App should render correctly 1`] = `
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveSuccessView": Object {
"childRouters": Object {
"ApproveSuccess": null,
},
"getActionCreators": [Function],
"getActionForPathAndParams": [Function],
"getComponentForRouteName": [Function],
"getComponentForState": [Function],
"getPathAndParamsForState": [Function],
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveView": Object {
"childRouters": Object {
"Approve": null,
Expand Down Expand Up @@ -515,18 +503,6 @@ exports[`App should render correctly 1`] = `
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveSuccessView": Object {
"childRouters": Object {
"ApproveSuccess": null,
},
"getActionCreators": [Function],
"getActionForPathAndParams": [Function],
"getComponentForRouteName": [Function],
"getComponentForState": [Function],
"getPathAndParamsForState": [Function],
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveView": Object {
"childRouters": Object {
"Approve": null,
Expand Down
24 changes: 0 additions & 24 deletions app/components/Nav/Main/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ exports[`Main should render correctly 1`] = `
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveSuccessView": Object {
"childRouters": Object {
"ApproveSuccess": null,
},
"getActionCreators": [Function],
"getActionForPathAndParams": [Function],
"getComponentForRouteName": [Function],
"getComponentForState": [Function],
"getPathAndParamsForState": [Function],
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveView": Object {
"childRouters": Object {
"Approve": null,
Expand Down Expand Up @@ -403,18 +391,6 @@ exports[`Main should render correctly 1`] = `
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveSuccessView": Object {
"childRouters": Object {
"ApproveSuccess": null,
},
"getActionCreators": [Function],
"getActionForPathAndParams": [Function],
"getComponentForRouteName": [Function],
"getComponentForState": [Function],
"getPathAndParamsForState": [Function],
"getScreenOptions": [Function],
"getStateForAction": [Function],
},
"ApproveView": Object {
"childRouters": Object {
"Approve": null,
Expand Down
13 changes: 0 additions & 13 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ import MessageSign from '../../UI/MessageSign';
import WalletConnectReturnToBrowserModal from '../../UI/WalletConnectReturnToBrowserModal';
import AsyncStorage from '@react-native-community/async-storage';
import Approve from '../../Views/ApproveView/Approve';
import ApproveSuccess from '../../Views/ApproveView/Success';
import Amount from '../../Views/SendFlow/Amount';
import Confirm from '../../Views/SendFlow/Confirm';
import ContactForm from '../../Views/Settings/Contacts/ContactForm';
Expand Down Expand Up @@ -289,18 +288,6 @@ const MainNavigator = createStackNavigator(
}
})
},
ApproveSuccessView: {
screen: createStackNavigator(
{
ApproveSuccess: {
screen: ApproveSuccess
}
},
{
headerMode: 'none'
}
)
},
AddBookmarkView: {
screen: createStackNavigator({
AddBookmark: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ exports[`ActionModal should render correctly 1`] = `
"alignItems": "center",
"flexDirection": "column",
"justifyContent": "center",
"marginHorizontal": 24,
}
}
>
Expand All @@ -55,7 +56,7 @@ exports[`ActionModal should render correctly 1`] = `
Object {
"backgroundColor": "#FFFFFF",
"borderRadius": 10,
"width": "90%",
"width": "100%",
}
}
>
Expand Down
5 changes: 3 additions & 2 deletions app/components/UI/ActionModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const styles = StyleSheet.create({
modalView: {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
marginHorizontal: 24
},
modalContainer: {
width: '90%',
width: '100%',
backgroundColor: colors.white,
borderRadius: 10
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ exports[`ActionView should render correctly 1`] = `
"borderTopWidth": 1,
"flex": 0,
"flexDirection": "row",
"padding": 16,
"paddingHorizontal": 24,
"paddingVertical": 16,
}
}
>
Expand Down
3 changes: 2 additions & 1 deletion app/components/UI/ActionView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const styles = StyleSheet.create({
borderTopWidth: 1,
flex: 0,
flexDirection: 'row',
padding: 16
paddingVertical: 16,
paddingHorizontal: 24
},
button: {
flex: 1
Expand Down
3 changes: 2 additions & 1 deletion app/components/UI/CustomGas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const styles = StyleSheet.create({
textAlign: 'center',
alignItems: 'flex-start',
width: '33%',
padding: 5
paddingVertical: 8,
paddingHorizontal: 10
},
advancedOptions: {
textAlign: 'right',
Expand Down
36 changes: 36 additions & 0 deletions app/components/UI/Radio/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Radio should render correctly 1`] = `
<Svg
height="12"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 12 12"
width="12"
>
<Circle
cx="6"
cy="6"
fill="none"
r="5.5"
stroke="#D2D8DD"
/>
</Svg>
`;

exports[`Radio should render correctly when selected 1`] = `
<Svg
height="12"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 12 12"
width="12"
>
<Circle
cx="6"
cy="6"
fill="none"
r="4"
stroke="#037dd6"
strokeWidth="4"
/>
</Svg>
`;
20 changes: 20 additions & 0 deletions app/components/UI/Radio/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import Svg, { Circle } from 'react-native-svg';
import { colors } from '../../../../app/styles/common';

const Radio = ({ selected }) => (
<Svg width="12" height="12" viewBox="0 0 12 12">
{selected ? (
<Circle cx="6" cy="6" r="4" stroke={colors.blue} strokeWidth="4" fill="none" />
) : (
<Circle cx="6" cy="6" r="5.5" stroke="#D2D8DD" fill="none" />
)}
</Svg>
);

Radio.propTypes = {
selected: PropTypes.bool
};

export default Radio;
14 changes: 14 additions & 0 deletions app/components/UI/Radio/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { shallow } from 'enzyme';
import Radio from './';

describe('Radio', () => {
it('should render correctly', () => {
const wrapper = shallow(<Radio />);
expect(wrapper).toMatchSnapshot();
});
it('should render correctly when selected', () => {
const wrapper = shallow(<Radio selected />);
expect(wrapper).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`StyledButton should render correctly on Android the button with type ca
style={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand All @@ -29,7 +29,7 @@ exports[`StyledButton should render correctly on Android the button with type co
style={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand All @@ -51,7 +51,7 @@ exports[`StyledButton should render correctly on Android the button with type no
style={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand All @@ -74,7 +74,7 @@ exports[`StyledButton should render correctly on Android the button with type or
style={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand All @@ -94,7 +94,7 @@ exports[`StyledButton should render correctly on iOS the button with type cancel
containerStyle={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand Down Expand Up @@ -129,7 +129,7 @@ exports[`StyledButton should render correctly on iOS the button with type confir
containerStyle={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand Down Expand Up @@ -163,7 +163,7 @@ exports[`StyledButton should render correctly on iOS the button with type normal
containerStyle={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand Down Expand Up @@ -198,7 +198,7 @@ exports[`StyledButton should render correctly on iOS the button with type orange
containerStyle={
Array [
Object {
"borderRadius": 4,
"borderRadius": 100,
"justifyContent": "center",
"padding": 15,
},
Expand Down
8 changes: 3 additions & 5 deletions app/components/UI/StyledButton/styledButtonStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { colors, fontStyles } from '../../../styles/common';
const styles = StyleSheet.create({
container: {
padding: 15,
borderRadius: 4,
borderRadius: 100,
justifyContent: 'center'
},
text: {
Expand Down Expand Up @@ -66,17 +66,15 @@ const styles = StyleSheet.create({
color: colors.grey400
},
warning: {
backgroundColor: colors.white,
borderWidth: 1,
borderColor: colors.red
backgroundColor: colors.red
},
info: {
backgroundColor: colors.white,
borderWidth: 1,
borderColor: colors.blue
},
warningText: {
color: colors.red
color: colors.white
},
neutral: {
backgroundColor: colors.white,
Expand Down
Loading