Skip to content

Commit 6151f16

Browse files
committed
Adjust styles
Signed-off-by: Mantas Domaševičius <mantas@mysterium.network>
1 parent c6e37a1 commit 6151f16

File tree

8 files changed

+159
-79
lines changed

8 files changed

+159
-79
lines changed

src/Pages/Authenticated/Onboarding/Password/AdvancedBoardingPage.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ import { devices } from '../../../../theme/themes'
3030

3131
const { api } = tequila
3232

33-
const { Page, StartButton, GTitle, GSubTitle, GDescription, GradientCard, Welcome, WhiteCard } = PasswordSetComponents
33+
const {
34+
Page,
35+
LockRow,
36+
StartButton,
37+
GTitle,
38+
GSubTitle,
39+
GDescription,
40+
GradientCard,
41+
Welcome,
42+
WhiteCard,
43+
} = PasswordSetComponents
3444

3545
const PasswordInputs = styled.div`
3646
display: flex;
@@ -242,6 +252,7 @@ export const AdvancedBoardingPage = () => {
242252
Easy setup? <InternalLink to={ROUTES.QUICK_ONBOARDING + location.search}>Quick onboarding</InternalLink>
243253
</GDescription>
244254
)}
255+
<LockRow />
245256
</GradientCard>
246257
</WhiteCard>
247258
</Form>

src/Pages/Authenticated/Onboarding/Password/PasswordSetComponents.tsx

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ import styled from 'styled-components'
88
import { Welcome } from './Welcome'
99
import { Button } from '../../../../Components/Inputs/Button'
1010
import { devices } from '../../../../theme/themes'
11+
import { ReactComponent as LockIcon } from '../../../../assets/images/onboarding/lock.svg'
1112

1213
const Page = styled.div`
14+
display: flex;
15+
justify-content: center;
16+
1317
padding: 66px;
1418
1519
@media ${devices.tablet} {
@@ -28,18 +32,18 @@ const WhiteCard = styled.div`
2832
background: ${({ theme }) => theme.onboarding.bgCard};
2933
border-radius: 30px;
3034
box-shadow: 0 20px 60px 0 #0000651a;
35+
width: 1100px;
3136
3237
display: flex;
3338
flex-direction: column;
3439
align-items: center;
35-
gap: 32px;
40+
gap: 16px;
3641
37-
min-height: calc(100vh - 66px - 66px);
38-
39-
padding: 20px;
42+
padding: 20px 20px 40px 20px;
4043
4144
@media ${devices.tablet} {
4245
padding: 15px;
46+
width: unset;
4347
}
4448
4549
@media ${devices.mobileS} {
@@ -54,7 +58,7 @@ const GradientCard = styled.div`
5458
position: relative;
5559
background: ${({ theme }) => theme.onboarding.bgCardGradient};
5660
box-shadow: 0 20px 60px 0 #0000651a;
57-
max-width: 70%;
61+
width: 650px;
5862
border-radius: 40px;
5963
padding: 62px 62px 62px 62px;
6064
@@ -66,6 +70,7 @@ const GradientCard = styled.div`
6670
6771
@media ${devices.tablet} {
6872
max-width: unset;
73+
width: unset;
6974
padding: 30px 10px 50px 10px;
7075
}
7176
@@ -126,6 +131,44 @@ const StartButton = styled(Button)`
126131
}
127132
`
128133

134+
const LockRow = () => (
135+
<LockContainer>
136+
<Lock />
137+
</LockContainer>
138+
)
139+
140+
const LockContainer = styled.div`
141+
position: relative;
142+
width: 100%;
143+
144+
@media ${devices.tablet} {
145+
}
146+
147+
@media ${devices.mobileS} {
148+
display: none;
149+
}
150+
`
151+
152+
const Lock = styled(LockIcon)`
153+
position: absolute;
154+
top: -20px;
155+
right: -130px;
156+
width: 186px;
157+
height: 160px;
158+
159+
@media ${devices.tablet} {
160+
position: absolute;
161+
left: 0;
162+
right: 0;
163+
top: 16px;
164+
margin-left: auto;
165+
margin-right: auto;
166+
167+
width: 106px;
168+
height: 80px;
169+
}
170+
`
171+
129172
export const PasswordSetComponents = {
130173
Page,
131174
WhiteCard,
@@ -135,4 +178,6 @@ export const PasswordSetComponents = {
135178
GDescription,
136179
StartButton,
137180
GSubTitle,
181+
Lock,
182+
LockRow,
138183
}

src/Pages/Authenticated/Onboarding/Password/QuickOnboardingPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { urls } from '../../../../commons/urls'
1919
import { ANDROID_DEEPLINK_CLICKBOARDING } from '../../../../constants/urls'
2020
import toasts from '../../../../commons/toasts'
2121

22-
const { Page, StartButton, GTitle, GDescription, GradientCard, Welcome, WhiteCard } = PasswordSetComponents
22+
const { Page, LockRow, StartButton, GTitle, GDescription, GradientCard, Welcome, WhiteCard } = PasswordSetComponents
2323

2424
export const QuickOnboardingPage = () => {
2525
const config = useAppSelector(selectors.currentConfig)
@@ -63,8 +63,10 @@ export const QuickOnboardingPage = () => {
6363
/>
6464
<StartButton size="large" label="START" rounded onClick={getLinkAndRedirect} />
6565
<GDescription $textAlign="center">
66-
Advanced onboarding <InternalLink to={ROUTES.ADVANCED_ONBOARDING + location.search}>Sign Up</InternalLink>
66+
Advanced onboarding{' '}
67+
<InternalLink to={ROUTES.ADVANCED_ONBOARDING + location.search}>Start here</InternalLink>
6768
</GDescription>
69+
<LockRow />
6870
</GradientCard>
6971
</WhiteCard>
7072
</Page>

src/Pages/Authenticated/Onboarding/Password/Welcome.tsx

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ import { devices } from '../../../../theme/themes'
99
import React from 'react'
1010
import { ReactComponent as LoginLogo } from '../../../../assets/images/onboarding/logo.svg'
1111

12-
const LogoContainer = styled.div`
13-
position: relative;
14-
width: 180px;
15-
height: 100px;
16-
`
17-
1812
const Container = styled.div`
1913
display: flex;
2014
flex-direction: column;
@@ -29,44 +23,41 @@ const Container = styled.div`
2923
}
3024
`
3125
const Logo = styled(LoginLogo)`
32-
position: absolute;
33-
right: -35%;
34-
top: -44%;
26+
width: 70px;
27+
height: 85px;
3528
@media ${devices.mobileS} {
3629
display: none;
3730
}
3831
`
3932

4033
const SubTitle = styled.h1`
41-
font-size: 50px;
34+
font-size: 30px;
4235
margin-top: 0;
43-
line-height: 30px;
4436
color: ${({ theme }) => theme.text.colorMain};
37+
text-align: center;
4538
@media ${devices.tablet} {
46-
font-size: 40px;
47-
line-height: 60px;
39+
font-size: 26px;
4840
}
4941
`
5042

5143
const Title = styled.h1`
5244
color: ${({ theme }) => theme.common.colorKey};
53-
line-height: 80px;
54-
font-size: 60px;
45+
46+
font-size: 40px;
47+
text-align: center;
5548
@media ${devices.tablet} {
56-
font-size: 50px;
57-
line-height: 60px;
49+
font-size: 30px;
5850
}
5951
@media ${devices.mobileS} {
60-
font-size: 40px;
61-
line-height: 40px;
52+
font-size: 20px;
6253
}
6354
`
6455
const Comment = styled.div`
6556
color: ${({ theme }) => theme.common.colorKeyLight};
66-
margin-top: 20px;
67-
font-size: 27px;
68-
line-height: 40px;
57+
margin-top: 10px;
58+
font-size: 18px;
6959
font-weight: 400;
60+
text-align: center;
7061
@media ${devices.tablet} {
7162
font-size: ${({ theme }) => theme.common.fontSizeBig};
7263
}
@@ -80,9 +71,7 @@ const Group = styled.div`
8071
export const Welcome = () => {
8172
return (
8273
<Container>
83-
<LogoContainer>
84-
<Logo />
85-
</LogoContainer>
74+
<Logo />
8675

8776
<Group>
8877
<Title>Welcome</Title>

src/Pages/ClickBoarding.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,29 @@ export const ClickBoarding = () => {
5151
setLoading(true)
5252
const info = await verifyOnboardingGrant({ authorizationGrantToken })
5353

54+
// Following actions must happen in this particular order
55+
const newPassword = strings.generate(16)
56+
57+
if (!info.isEligibleForFreeRegistration) {
58+
setLoading(false)
59+
60+
await tequila.api.authChangePassword({ oldPassword: DEFAULT_PASSWORD, newPassword, username: DEFAULT_USERNAME })
61+
await tequila.api.setMMNApiKey(info.apiKey) // calls mystnodes.com and marks node for free registration if it is first one
62+
63+
setTimeout(() => {
64+
navigate(ROUTES.DASHBOARD, { replace: true })
65+
}, 3000)
66+
return
67+
}
68+
5469
if ([IdentityRegistrationStatus.InProgress, IdentityRegistrationStatus.Registered].includes(registrationStatus)) {
5570
//Error - identity already registered or in progress
5671
setLoading(false)
57-
setError('Identity was already registered or registration is in progress!')
72+
73+
await tequila.api.authChangePassword({ oldPassword: DEFAULT_PASSWORD, newPassword, username: DEFAULT_USERNAME })
74+
5875
setTimeout(() => {
59-
navigate(ROUTES.HOME, { replace: true })
76+
navigate(ROUTES.DASHBOARD, { replace: true })
6077
}, 3000)
6178
return
6279
}
@@ -83,9 +100,6 @@ export const ClickBoarding = () => {
83100
}
84101

85102
// Following actions must happen in this particular order
86-
const newPassword = strings.generate(16)
87-
await tequila.api.authChangePassword({ oldPassword: DEFAULT_PASSWORD, newPassword, username: DEFAULT_USERNAME })
88-
await tequila.api.setMMNApiKey(info.apiKey) // calls mystnodes.com and marks node for free registration if it is first one
89103
await tequila.api.identityRegister(id, { beneficiary: info.walletAddress, stake: 0 })
90104
await complexActions.loadAppStateAfterAuthenticationAsync({ isDefaultPassword: false })
91105
setLoading(false)

src/api/tequila.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,19 @@ const loginWithAuthorizationGrant = async ({ authorizationGrantToken }: { author
105105

106106
const getUIFeatures = async () => await http.get('/config/ui/features').then((r) => r.data)
107107

108-
export type LWAGResponse = {
108+
export type GrantVerificationResponse = {
109109
apiKey: string
110110
walletAddress?: string
111+
isEligibleForFreeRegistration: boolean
111112
}
112113

113114
const verifyOnboardingGrant = async ({
114115
authorizationGrantToken,
115116
}: {
116117
authorizationGrantToken: string
117-
}): Promise<LWAGResponse> =>
118+
}): Promise<GrantVerificationResponse> =>
118119
http
119-
.post<LWAGResponse>('/mmn/onboarding/verify-grant', { authorization_grant: authorizationGrantToken })
120+
.post<GrantVerificationResponse>('/mmn/onboarding/verify-grant', { authorization_grant: authorizationGrantToken })
120121
.then((r) => r.data)
121122

122123
const exportIdentity = async (request: any): Promise<unknown> =>

0 commit comments

Comments
 (0)