Skip to content

Commit 1fa1827

Browse files
committed
Merge branch 'develop' into or/issue-760/build-advanced-wallet-setup
2 parents 4ba0ded + c6f93b6 commit 1fa1827

25 files changed

+201
-35
lines changed

api/schema/resolvers/ContributorResolver.js

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ module.exports = {
8282
contributor_id: contributor.id
8383
}
8484
})
85+
},
86+
wallet: async (root, args, { cookies, models }) => {
87+
return models.Wallet.findOne({
88+
where: {
89+
contributor_id: cookies.userSession
90+
}
91+
})
8592
}
8693
},
8794
Query: {

api/schema/resolvers/WalletResolver.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ module.exports = {
77
Query: {
88
},
99
Mutation: {
10-
updateContributorOnChainAddress: async (root, { contributor_id, address }, { models }) => {
10+
updateContributorOnChainAddress: async (root, { contributor_id, address }, { cookies, models }) => {
11+
const contributorId = cookies.userSession ?? contributor_id
1112
const contributorWallet = await models.Wallet.findOne({
1213
where: {
13-
contributor_id: contributor_id
14+
contributor_id: contributorId
1415
}
1516
})
1617
if (!contributorWallet) {
1718
const createFields = {
18-
contributor_id: contributor_id,
19+
contributor_id: contributorId,
1920
onchain_address: address
2021
}
2122
const wallet = await models.Wallet.create({
@@ -32,7 +33,7 @@ module.exports = {
3233
})
3334
return models.Wallet.findOne({
3435
where: {
35-
contributor_id: contributor_id
36+
contributor_id: contributorId
3637
}
3738
})
3839
},

api/schema/types/ContributorType.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = gql`
1919
"The following attributes are calculated and aren't on the database"
2020
totalPaid: Int!
2121
paidByCurrency: [TotalAllocatedByCurrency]
22+
wallet: Wallet
2223
}
2324
2425
input CreateContributorInput {

src/components/AllocationTile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from '../scripts/selectors'
2020
import colors from '../styles/colors.module.scss'
2121

22-
const { grey, orange, red, setlifeBlue } = colors
22+
const { gray, orange, red, setlifeBlue } = colors
2323

2424
const AllocationTile = (props) => {
2525

@@ -98,7 +98,7 @@ const AllocationTile = (props) => {
9898
<Box
9999
color={
100100
`${!allocation.date_paid
101-
? `${grey}`
101+
? `${gray}`
102102
: futureAllocation
103103
? `${orange}`
104104
: `${setlifeBlue}`
@@ -120,7 +120,7 @@ const AllocationTile = (props) => {
120120
<Box
121121
color={
122122
`${!allocation.date_paid
123-
? `${grey}`
123+
? `${gray}`
124124
: weeksOfdDifference == 2
125125
? `${red}`
126126
: futureAllocation

src/components/ProjectSummary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const ProjectSummary = (props) => {
6767
<Grid xs={10} align='left'>
6868
<Typography
6969
variant=''
70-
className='grey-link'
70+
className='gray-link'
7171
onClick={goToClientPage}
7272
>
7373
<span>

src/styles/App.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ body {
4949
//color: $blue;
5050
}
5151

52-
.grey-link {
52+
.gray-link {
5353
cursor: pointer;
5454
:hover {
55-
color: $grey
55+
color: $gray
5656
}
5757
}
5858

src/styles/Navigation.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
.icon-settings {
1313
cursor: pointer;
14-
color: $grey;
14+
color: $gray;
1515
opacity: 0.5;
1616
transition: opacity .5s;
1717
}

src/styles/RangeDatePicker.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
.date-picker {
3434
border: 1px solid $light_grey;
35-
color: $grey;
35+
color: $gray;
3636

3737

3838

src/styles/colors.module.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $black: #000000;
33
$blue: #2196f3;
44
$dark-blue: #009BAD;
55
$green: #4caf50;
6-
$grey: #828282;
6+
$gray: #828282;
77
$light_blue: #d9f6f8;
88
$light_grey: #F1F1F1;
99
$orange: #ff9800;
@@ -16,7 +16,7 @@ $white: #FFFFFF;
1616
setlifeBlue: $setlife-blue;
1717
lightBlue: $light_blue;
1818
darkBlue: $dark-blue;
19-
grey: $grey;
19+
gray: $gray;
2020
lightGrey: $light_grey;
2121
white: $white;
2222
black: $black;

src/styles/theme.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const {
1515
setlifeBlue,
1616
lightBlue,
1717
darkBlue,
18-
grey,
18+
gray,
1919
lightGrey,
2020
black,
2121
white
@@ -75,7 +75,7 @@ const theme = createMuiTheme({
7575
light: white
7676
},
7777
secondary: {
78-
main: grey,
78+
main: gray,
7979
light: lightGrey
8080
},
8181
action: {

srcv2/App.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import OnboardingPage from './pages/OnboardingPage'
1515
import OnboardingContributorPage from './pages/OnboardingContributorPage'
1616
import ProjectDetailPage from './pages/ProjectDetailPage'
1717
import WalletSetupPage from './pages/WalletSetupPage'
18+
import WalletSimpleSetupPage from './pages/WalletSimpleSetupPage'
1819
import AdvancedWalletSetup from './components/AdvancedWalletSetup'
1920

2021
class App extends React.Component {
@@ -74,7 +75,12 @@ class App extends React.Component {
7475
exact
7576
path='/wallet/setup'
7677
component={WalletSetupPage}
77-
/>
78+
/>
79+
<PrivateRoute
80+
exact
81+
path='/wallet/setup/simple'
82+
component={WalletSimpleSetupPage}
83+
/>
7884
<PrivateRoute
7985
exact
8086
path='/wallet/setup/advanced'

srcv2/components/AllocationTile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const AllocationTile = (props) => {
9393
</p>
9494
{allocation.status == 'pending' &&
9595
<button type='button' onClick={() => setAllocationOptionsOpen(!allocationOptionsOpen)}>
96-
<Icon className='fas fa-chevron-down my-auto text-grey'/>
96+
<Icon className='fas fa-chevron-down my-auto text-gray'/>
9797
</button>
9898
}
9999
</div>

srcv2/components/BudgetingOnboarding.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ const BudgetingOnboarding = (props) => {
2626
<p className='text-3xl text-center font-bold'>
2727
Budgeting
2828
</p>
29-
<p className='text-grey text-xl text-center font-bold'>
29+
<p className='text-gray text-xl text-center font-bold'>
3030
Allocate funds to your team
3131
</p>
32-
<p className='text-grey text-xl text-center font-bold'>
32+
<p className='text-gray text-xl text-center font-bold'>
3333
Negotiate compensation rates
3434
</p>
3535
</div>

srcv2/components/ProjectTile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ProjectTile = (props) => {
2121
<p>{project.expected_budget_currency}</p>
2222
</div>
2323
</div>
24-
<hr/>
24+
<hr className='text-light'/>
2525
</div>
2626
)
2727
}

srcv2/components/WalletOption.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ const WalletOption = ({
2828
<div className={`bg-white rounded-lg border-light border-2 !py-3 px-6`}>
2929
<div className='flex'>
3030
<div className='mr-4 self-center'>
31-
<Icon className={`icon fas fa-${icon} my-auto !w-8 ${disabled ? 'text-grey' : 'text-setlife'}`}/>
31+
<Icon className={`icon fas fa-${icon} my-auto !w-8 ${disabled ? 'text-gray' : 'text-setlife'}`}/>
3232
</div>
3333
<div>
34-
<p className={`text-base font-semibold ${disabled ? 'text-grey' : ''}`}>
34+
<p className={`text-base font-semibold ${disabled ? 'text-gray' : ''}`}>
3535
{`${count + 1}. ${title}`}
3636
</p>
37-
<p className={`text-sm ${disabled ? 'text-grey' : ''}`}>
37+
<p className={`text-sm ${disabled ? 'text-gray' : ''}`}>
3838
{subtitle}
3939
</p>
4040
</div>

srcv2/operations/mutations/WalletMutations.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import { gql } from '@apollo/client';
22

3+
export const UPDATE_WALLET_ADDRESS = gql`
4+
mutation updateContributorOnChainAddress(
5+
$address: String!
6+
) {
7+
updateContributorOnChainAddress(address: $address) {
8+
id
9+
}
10+
}
11+
`
12+
313
export const UPDATE_NODE = gql`
414
mutation updateContributorNode(
515
$host: String,

srcv2/operations/queries/ContributorQueries.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export const CHECK_SESSION = gql`
1111
toggl_id
1212
external_data_url
1313
totalPaid
14+
wallet {
15+
onchain_address
16+
}
1417
}
1518
}
1619
`

srcv2/pages/LandingPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const LandingPage = () => {
3434
return FEATURES.map((feature, idx) => {
3535
const goals = feature.goals.map(goal => {
3636
return (
37-
<p className='goal text-center font-bold text-xl text-grey'>
37+
<p className='goal text-center font-bold text-xl text-gray'>
3838
{goal}
3939
</p>
4040
)
@@ -66,7 +66,7 @@ const LandingPage = () => {
6666
<p className='text-5xl text-center font-bold'>
6767
Trinary
6868
</p>
69-
<p className='text-grey text-2xl text-center font-bold'>
69+
<p className='text-gray text-2xl text-center font-bold'>
7070
Build a “micro-economy” for your team to share knowledge, trade feedback, & hold each other accountable
7171
</p>
7272
</div>

srcv2/pages/LoginPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const LoginPage = () => {
1515
<p className='text-4xl font-bold'>
1616
Log in
1717
</p>
18-
<p className='font-bold text-xl text-grey'>
18+
<p className='font-bold text-xl text-gray'>
1919
A budgeting tool for tracking workflows and cashflows while collaborating with others on projects
2020
</p>
2121
</div>

srcv2/pages/ProjectDetailPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const ProjectDetailPage = (props) => {
4141
return (
4242
<div className='contributor w-14'>
4343
<div className='rounded-full h-14 w-14 bg-light text-4xl'>
44-
<Icon className='icon fas fa-user text-grey text-center w-full h-full mt-2.5' fontSize='inherit'/>
44+
<Icon className='icon fas fa-user text-gray text-center w-full h-full mt-2.5' fontSize='inherit'/>
4545
</div>
4646
<div className='w-full'>
4747
<p className='text-center'>{contributor.name}</p>
@@ -75,7 +75,7 @@ const ProjectDetailPage = (props) => {
7575
</div>
7676
</div>
7777
<button type='button' className='text-right w-fit ml-auto' onClick={() => history.push(`/payments/edit/${payment.id}`)}>
78-
<Icon className='fas fa-pen text-grey' fontSize='small'/>
78+
<Icon className='fas fa-pen text-gray' fontSize='small'/>
7979
</button>
8080
</div>
8181
)

srcv2/pages/WalletSetupPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const WalletSetupPage = () => {
2222
}
2323

2424
return (
25-
<div className='WalletSetupPage bg-med-grey h-full min-h-screen'>
25+
<div className='WalletSetupPage bg-med-gray h-full min-h-screen'>
2626
<Section>
2727
<p className='text-3xl font-bold mb-2'>
2828
{'Choose one option'}

0 commit comments

Comments
 (0)