Skip to content

Commit 3fe380b

Browse files
committed
fix: add new payment tab
1 parent 56d3b4a commit 3fe380b

File tree

7 files changed

+142
-1
lines changed

7 files changed

+142
-1
lines changed

__tests__/shared/components/Settings/__snapshots__/index.jsx.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ exports[`renders account setting page correctly 1`] = `
4848
"link": "preferences",
4949
"title": "Preferences",
5050
},
51+
Object {
52+
"link": "payment",
53+
"title": "Payment",
54+
},
5155
]
5256
}
5357
/>
@@ -805,6 +809,10 @@ exports[`renders preferences setting page correctly 1`] = `
805809
"link": "preferences",
806810
"title": "Preferences",
807811
},
812+
Object {
813+
"link": "payment",
814+
"title": "Payment",
815+
},
808816
]
809817
}
810818
/>
@@ -1559,6 +1567,10 @@ exports[`renders profile setting page correctly 1`] = `
15591567
"link": "preferences",
15601568
"title": "Preferences",
15611569
},
1570+
Object {
1571+
"link": "payment",
1572+
"title": "Payment",
1573+
},
15621574
]
15631575
}
15641576
/>
@@ -2319,6 +2331,10 @@ exports[`renders tools setting page correctly 1`] = `
23192331
"link": "preferences",
23202332
"title": "Preferences",
23212333
},
2334+
Object {
2335+
"link": "payment",
2336+
"title": "Payment",
2337+
},
23222338
]
23232339
}
23242340
/>

src/shared/actions/page/settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const TABS = {
1111
TOOLS: 'tools',
1212
ACCOUNT: 'account',
1313
PREFERENCES: 'preferences',
14+
PAYMENT: 'payment',
1415
};
1516

1617
export default createActions({
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* eslint-disable prefer-destructuring */
2+
import React from 'react';
3+
4+
import ErrorWrapper from '../ErrorWrapper';
5+
6+
import './styles.scss';
7+
8+
export default class Payment extends React.Component {
9+
constructor(props) {
10+
super(props);
11+
this.state = {};
12+
}
13+
14+
render() {
15+
return (
16+
<ErrorWrapper>
17+
<div styleName="payment-container">
18+
<div styleName="header">
19+
<h3>Payment Settings</h3>
20+
</div>
21+
<div styleName="platform-banner" />
22+
</div>
23+
<div styleName="footer" />
24+
</ErrorWrapper>
25+
);
26+
}
27+
}
28+
29+
Payment.defaultProps = {
30+
};
31+
32+
Payment.propTypes = {
33+
};
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
@import '~styles/mixins';
2+
3+
.payment-container {
4+
background-color: $listing-filter-bg;
5+
padding: $pad-xxxxl;
6+
border-radius: 8px;
7+
margin: 32px 0 32px;
8+
9+
@include xs-to-sm {
10+
padding: $pad-xxl $pad-lg;
11+
margin: 24px 0 24px;
12+
}
13+
14+
.header {
15+
margin: 0 0 40px;
16+
17+
@include xs-to-sm {
18+
margin: 0 0 $pad-xxl;
19+
}
20+
21+
h3 {
22+
@include barlow-bold;
23+
24+
font-size: 20px;
25+
font-weight: 600;
26+
line-height: 22px;
27+
color: $tco-black;
28+
text-transform: uppercase;
29+
30+
@include xs-to-md {
31+
@include barlow-condensed-semi-bold;
32+
33+
font-weight: 500;
34+
font-size: 22px;
35+
line-height: 24px;
36+
}
37+
}
38+
}
39+
40+
.platform-banner {
41+
background-color: $tc-white;
42+
border-radius: 4px;
43+
width: 100%;
44+
padding: 32px;
45+
46+
@include xs-to-sm {
47+
padding: 24px 16px;
48+
}
49+
}
50+
}
51+
52+
.footer {
53+
display: flex;
54+
flex-direction: row-reverse;
55+
56+
.save-changes-btn {
57+
@include roboto-bold;
58+
59+
font-weight: 700;
60+
font-size: 16px;
61+
line-height: 24px;
62+
border-radius: 50px !important;
63+
background: #137d60 !important;
64+
color: #fff !important;
65+
text-transform: uppercase;
66+
padding: 11px 23px;
67+
margin: 0;
68+
69+
&.disabled {
70+
opacity: 0.5;
71+
}
72+
}
73+
74+
@include xs-to-md {
75+
padding: $pad-xxxxl 0 $pad-sm;
76+
border-top: 2px solid $color-black-10;
77+
78+
.save-changes-btn {
79+
font-size: 14px;
80+
line-height: 20px;
81+
}
82+
}
83+
}

src/shared/components/Settings/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const SETTINGS_TABS = [
1212
{ title: 'Tools', link: TABS.TOOLS },
1313
{ title: 'Account', link: TABS.ACCOUNT },
1414
{ title: 'Preferences', link: TABS.PREFERENCES },
15+
{ title: 'Payment', link: TABS.PAYMENT },
1516
];
1617

1718
export const PROFILE_SETTINGS = {

src/shared/components/Settings/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Tools from './Tools';
1616
import './style.scss';
1717
import Account from './Account';
1818
import Preferences from './Preferences';
19+
import Payment from './Payment';
1920
import TabSelector from './TabSelector';
2021
import { SETTINGS_TABS } from './constants';
2122

@@ -140,6 +141,12 @@ export default function Settings(props) {
140141
/>
141142
)
142143
}
144+
{
145+
newProps.settingsTab === TABS.PAYMENT
146+
&& (
147+
<Payment />
148+
)
149+
}
143150
</div>
144151
</div>
145152
);

src/shared/routes/Settings/Router.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Error404 from 'components/Error404';
1616
export default function Router({ base }) {
1717
return (
1818
<Switch>
19-
<Route component={Settings} exact path={`${base}/:settingsTab(profile|skills|tracks|tools|account|preferences)`} />
19+
<Route component={Settings} exact path={`${base}/:settingsTab(profile|skills|tracks|tools|account|preferences|payment)`} />
2020
<Route component={EmailVerification} exact path={`${base}/account/changeEmail`} />
2121
<Route component={Success} exact path={`${base}/account/email-verification/success`} />
2222
<Route component={Failed} exact path={`${base}/account/email-verification/failure`} />

0 commit comments

Comments
 (0)