Skip to content

Commit

Permalink
Merge pull request #30 from artsemkavaleu-deriv/57153
Browse files Browse the repository at this point in the history
Artsem / My Profile page fix styles
  • Loading branch information
carolsachdeva committed Feb 25, 2022
2 parents 915ed72 + 8633a96 commit f7cb8d2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/p2p/src/components/misc/toggle-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
border-radius: $BORDER_RADIUS;

@include tablet-up {
margin: 2.4rem 0;
margin: 2.4rem 0 4.8rem;
}

@include mobile {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.my-profile-balance {
display: flex;
align-items: center;

&__amount {
margin-right: 0.8rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import MyProfileBalance from '../my-profile-balance';
import MyProfileDetailsTable from '../my-profile-details-table';
import MyProfileName from '../my-profile-name';
import { useStores } from 'Stores';
import './my-profile-details-container.scss';

const MyProfileDetailsContainer = () => {
const { my_profile_store } = useStores();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.my-profile-details-container {
border: 1px solid var(--general-hover);
border-radius: 0.8rem;
margin-top: 2.4rem;
padding: 2.4rem;

@include mobile {
Expand All @@ -10,5 +11,6 @@

&--table {
display: flex;
justify-content: space-between;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
flex-direction: column;
padding-right: 2.4rem;
white-space: nowrap;
height: 4rem;
margin-top: 1rem;

@include mobile {
border-right: unset;
Expand All @@ -28,6 +30,7 @@
display: flex;
flex-direction: row;
width: 29.2rem;
border: none;

@include mobile {
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.my-profile-name {
align-items: center;
display: flex;
margin: 2.4rem 0;
margin-bottom: 2.4rem;
width: 100%;

@include mobile {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { Table, Text } from '@deriv/components';
import { Money, Table, Text } from '@deriv/components';
import { isMobile } from '@deriv/shared';
import { observer } from 'mobx-react-lite';
import { Localize } from 'Components/i18next';
import { useStores } from 'Stores';

const MyProfileStatsTable = () => {
const { my_profile_store } = useStores();
const { my_profile_store, general_store } = useStores();

const {
buy_completion_rate,
Expand Down Expand Up @@ -116,7 +116,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{buy_time_avg || '-'}
{buy_time_avg ? `${buy_time_avg} min` : '-'}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand All @@ -134,7 +134,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{release_time_avg || '-'}
{release_time_avg ? `${release_time_avg} min` : '-'}
</Text>
</Table.Cell>
</Table.Row>
Expand All @@ -160,7 +160,15 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{total_turnover || '-'}
{total_turnover ? (
<Money
amount={total_turnover}
currency={general_store.client.currency}
show_currency
/>
) : (
'-'
)}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand Down Expand Up @@ -222,7 +230,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{buy_completion_rate ? `${buy_completion_rate} (${buy_orders_count})` : '-'}
{buy_completion_rate ? `${buy_completion_rate}% (${buy_orders_count})` : '-'}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand All @@ -240,7 +248,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{sell_completion_rate ? `${sell_completion_rate} (${sell_orders_count})` : '-'}
{sell_completion_rate ? `${sell_completion_rate}% (${sell_orders_count})` : '-'}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand All @@ -258,7 +266,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{buy_time_avg || '-'}
{buy_time_avg ? `${buy_time_avg} min` : '-'}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand All @@ -276,7 +284,7 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{release_time_avg || '-'}
{release_time_avg ? `${release_time_avg} min` : '-'}
</Text>
</Table.Cell>
</Table.Row>
Expand Down Expand Up @@ -304,7 +312,11 @@ const MyProfileStatsTable = () => {
/>
</Text>
<Text as='p' color='prominent' line_height='m' size='xs' weight='bold'>
{total_turnover || '-'}
{total_turnover ? (
<Money amount={total_turnover} currency={general_store.client.currency} show_currency />
) : (
'-'
)}
</Text>
</Table.Cell>
<Table.Cell className='my-profile-stats-table__cell'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

& + & {
padding: 0 4rem;
padding-left: 2.4rem;

@include mobile {
padding: 0.4rem 1.6rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useStores } from 'Stores';
import MyProfileStatsTable from './my-profile-stats-table';
import MyProfileSeparatorContainer from '../my-profile-separator-container';
import { Localize, localize } from 'Components/i18next';
import { isMobile } from '@deriv/shared';
import MyProfilePrivacy from './my-profile-privacy';

const MyProfileStats = () => {
Expand All @@ -24,7 +23,6 @@ const MyProfileStats = () => {
>
<MyProfileStatsTable />
</MobileFullPageModal>
<MyProfileSeparatorContainer.Line className='my-profile-stats-separator' is_invisible={isMobile()} />
<DesktopWrapper>
<MyProfileStatsTable />
</DesktopWrapper>
Expand Down

0 comments on commit f7cb8d2

Please sign in to comment.