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

Sergei / FEQ-2201, FEQ-2241, FEQ-2232, FEQ-2223, FEQ-2222 / Fix tablet view issue #15349

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
border-color: var(--general-disabled);
}

@include mobile {
@include mobile-or-tablet-screen {
input[type='date']::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
Expand Down Expand Up @@ -148,7 +148,7 @@
}
}
}
@include mobile {
@include mobile-or-tablet-screen {
&--hint {
margin-bottom: 5rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DatePicker = React.memo((props: TDatePicker) => {
const [duration, setDuration] = React.useState<number | null | string>(daysFromTodayTo(value));
const [is_datepicker_visible, setIsDatepickerVisible] = React.useState(false);
const [is_placeholder_visible, setIsPlaceholderVisible] = React.useState(!!placeholder && !value);
const { isMobile } = useDevice();
const { isMobile, isTablet } = useDevice();

useOnClickOutside(
datepicker_ref,
Expand Down Expand Up @@ -197,7 +197,7 @@ const DatePicker = React.memo((props: TDatePicker) => {
const getInputValue = (): string | number => (mode === 'duration' ? duration || 0 : date);

const getCalendarValue = (new_date: string | null): string | null => {
if (!new_date) return isMobile ? null : toMoment(start_date || max_date).format(date_format);
if (!new_date) return isMobile || isTablet ? null : toMoment(start_date || max_date).format(date_format);
return convertDateFormat(new_date, display_format, date_format);
};

Expand All @@ -216,7 +216,7 @@ const DatePicker = React.memo((props: TDatePicker) => {
...other_props,
};

if (isMobile) {
if (isMobile || isTablet) {
return (
<Native
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
&--error {
text-transform: none;
}
@include mobile {
@include mobile-or-tablet-screen {
&--absolute {
top: unset;
bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Field, Formik } from 'formik';
import PropTypes from 'prop-types';
import React from 'react';
import { useDevice } from '@deriv-com/ui';
import { FormSubmitButton, Icon, Text, ThemedScrollbars } from '@deriv/components';
import { localize, Localize } from '@deriv/translations';
import { observer, useStore } from '@deriv/stores';
import { isMobile, reorderCurrencies, website_name } from '@deriv/shared';
import { reorderCurrencies, website_name } from '@deriv/shared';
import { CurrencyRadioButtonGroup, CurrencyRadioButton } from '@deriv/account';
import './currency-selector.scss';

Expand Down Expand Up @@ -41,6 +42,7 @@ const AddCryptoCurrency = observer(
value,
hasNoAvailableCrypto,
}) => {
const { isDesktop } = useDevice();
const { client, ui } = useStore();
const { available_crypto_currencies, upgradeable_currencies: legal_allowed_currencies, has_fiat } = client;
const { should_show_cancel } = ui;
Expand Down Expand Up @@ -176,7 +178,7 @@ const AddCryptoCurrency = observer(
className='currency-selector__button'
is_disabled={isSubmitting || !values.currency}
label={localize('Add account')}
is_absolute={!isMobile()}
is_absolute={isDesktop}
form_error={form_error}
has_cancel={should_show_cancel}
cancel_label={localize('Back')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
justify-content: center !important;
}

@include desktop {
@include desktop-screen {
justify-content: flex-start;
}

@include mobile {
@include mobile-or-tablet-screen {
display: grid;
grid-template-columns: 1fr 1fr;
justify-items: center;
Expand Down Expand Up @@ -68,7 +68,7 @@
height: 48px;
width: 48px;
margin-bottom: 1em;
@include mobile {
@include mobile-or-tablet-screen {
height: 64px;
width: 64px;
margin-bottom: 0.8rem;
Expand All @@ -79,7 +79,7 @@
@include typeface(--paragraph-center-normal-black);
color: var(--text-general);
}
@include mobile {
@include mobile-or-tablet-screen {
margin: 1.6rem 2rem 0.8rem;
padding: 0.8rem 0;
width: 85%;
Expand All @@ -101,14 +101,14 @@
top: -4.8rem;
margin-top: -16px;

@include mobile {
@include mobile-or-tablet-screen {
right: 0;
top: -5.8rem;
}
}

&__loading-wrapper {
@include desktop {
@include desktop-screen {
min-width: 768px;
}
}
Expand All @@ -120,7 +120,7 @@
width: 90%;
border-top: 1px solid var(--general-section-1);

@include mobile {
@include mobile-or-tablet-screen {
border-top-width: 2px;
border-color: var(--border-disabled);
margin-left: -2.4rem;
Expand All @@ -141,7 +141,7 @@
color: var(--text-prominent);
}

@include desktop {
@include desktop-screen {
margin-bottom: 0.4rem;
margin-left: auto;
margin-right: auto;
Expand Down
40 changes: 20 additions & 20 deletions packages/core/src/sass/account-wizard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
display: flex;
flex-direction: column;
transition: all 0.3s ease-in-out;
@include tablet {
@include tablet-screen {
max-height: calc(100vh - 10.2rem) !important; // Header and footer
}
background-color: var(--general-main-1);
Expand Down Expand Up @@ -112,7 +112,7 @@
border-top: none;
padding: 2.4rem;
}
@include mobile {
@include mobile-or-tablet-screen {
width: 30rem !important;
}
}
Expand All @@ -124,7 +124,7 @@
&-body {
text-align: center;
padding: 2.4rem 2.4rem 0rem;
@include mobile {
@include mobile-or-tablet-screen {
padding: 1.6rem 1.6rem 0rem;
}
.risk-acceptance__text {
Expand Down Expand Up @@ -177,7 +177,7 @@
height: calc(100% - 5.7rem);
position: relative;
width: 100%;
@include desktop {
@include desktop-screen {
transform: translateY(0);
&--deriv-crypto {
grid-template-rows: 0 !important;
Expand All @@ -195,7 +195,7 @@
z-index: 1;
}
}
@include mobile {
@include mobile-or-tablet-screen {
grid-template-rows: 1fr auto;
overflow: hidden;

Expand All @@ -210,12 +210,12 @@
& .dc-form-submit-button {
padding: 2rem;
}
@include desktop {
@include desktop-screen {
& form {
grid-template-rows: auto;
}
}
@include mobile {
@include mobile-or-tablet-screen {
grid-template-rows: 1fr 1fr;
overflow-y: auto;
overflow-x: hidden;
Expand All @@ -226,7 +226,7 @@
margin-top: 2.4rem;
@include typeface(--title-center-bold-black);
color: var(--text-less-prominent);
@include mobile {
@include mobile-or-tablet-screen {
margin-top: 0.8rem;
font-size: 1.2rem;
}
Expand Down Expand Up @@ -264,7 +264,7 @@
&__description {
margin-top: 2.4rem;
@include typeface(--paragraph-center-normal-prominent);
@include mobile {
@include mobile-or-tablet-screen {
width: 100%;
padding: 1.6rem;
text-align: center;
Expand All @@ -280,7 +280,7 @@
}
&__container {
width: 100%;
@include mobile {
@include mobile-or-tablet-screen {
overflow-x: hidden;
overflow-y: auto;

Expand All @@ -292,7 +292,7 @@
&__button {
margin-top: 1.6rem;
}
@include mobile {
@include mobile-or-tablet-screen {
&--deriv-account {
border-top: 2px solid var(--general-section-1);
padding-top: 1rem;
Expand All @@ -309,7 +309,7 @@
display: flex;

& .details-form {
@include tablet {
@include tablet-screen {
grid-template-rows: minmax(10rem, 1fr);
}
}
Expand All @@ -321,14 +321,14 @@
text-transform: initial;
color: var(--text-prominent);

@include mobile {
@include mobile-or-tablet-screen {
font-size: 1.2rem;
margin: 2.4rem auto 0 2.4rem;
text-align: left;
}
}
h2 {
@include mobile {
@include mobile-or-tablet-screen {
font-size: 1.2rem;
text-align: left;
margin-left: 2.4rem;
Expand Down Expand Up @@ -380,7 +380,7 @@
}
}
}
@include mobile {
@include mobile-or-tablet-screen {
&--error {
margin-top: $MOBILE_HEADER_HEIGHT;
display: flex;
Expand Down Expand Up @@ -462,7 +462,7 @@
width: 100%;
}

@include mobile {
@include mobile-or-tablet-screen {
.dc-form-submit-button {
position: fixed;
bottom: 0;
Expand Down Expand Up @@ -504,7 +504,7 @@
height: 100%;
width: 100%;
margin-top: 0.3rem;
@include mobile {
@include mobile-or-tablet-screen {
border-top-color: var(--general-disabled);
}
}
Expand Down Expand Up @@ -582,7 +582,7 @@
margin: 2.4rem 0 0;
padding-left: 12rem;

@include mobile {
@include mobile-or-tablet-screen {
padding-left: 1.6rem;
}
}
Expand Down Expand Up @@ -776,7 +776,7 @@
.personal-details-form,
.address-details-form {
width: 100%;
@include desktop {
@include desktop-screen {
padding: 0 16rem;
}
}
Expand All @@ -800,7 +800,7 @@
}
.financial-assessment__form {
width: 70%;
@include mobile {
@include mobile-or-tablet-screen {
width: 100%;
}
}
Expand Down