Skip to content

Commit

Permalink
Merge pull request #647 from adshares/develop
Browse files Browse the repository at this point in the history
Responsiveness
  • Loading branch information
PawZar authored Apr 30, 2019
2 parents 423669f + d05b2f5 commit 19e8db1
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

.targeting-custom-option {
&__form {
@include container(
$border-color: pal(gray, light),
$padding-vertical: 8px,
$padding-horizontal: 8px,
$margin-top: 0
);
border-top-color: transparent;
cursor: pointer;
width: 100%;
padding: 8px;

&--input-hidden {
display: flex;
Expand All @@ -25,7 +32,6 @@
}

&__btn {
margin-top: 8px;
border: none;
background: transparent;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,47 @@
[(ngModel)]="searchTerm"
(input)="onSearchTermChange()"
title="Search for targeting option"
class="
dwmth-form-input
dwmth-form-input--full"
class="targeting-select__input"
data-test="common-targeting-select-search-input"
>
<img
src="/assets/images/search.svg"
alt=""
class="
dwmth-icon--prepend
search-icon
absolute"
>
class="targeting-select__search-icon">
</div>

<button
tabindex="0"
*ngIf="backAvailable"
(click)="changeViewModel(parentViewModel)"
role="button"
class="
dwmth-box
dwmth-box--no-margin
dwmth-box--light-border
parent-option-box"
data-test="common-targeting-select-navigate-to-parent-button"
>
class="targeting-select__option targeting-select__option--back"
data-test="common-targeting-select-navigate-to-parent-button">
<img
class="dwmth-icon--prepend"
class="targeting-select__input-icon"
src="/assets/images/chevron--left.svg"
alt="Go back"
>
<span
class="
dwmth-copy
parent-option"
data-test="common-targeting-select-parent-option"
>
alt="Go back">
<span class="targeting-select__parent-option"
data-test="common-targeting-select-parent-option">
{{ parentOption.label }}
</span>
</button>

<ul *ngFor="let option of viewModel">
<li class="dwmth-box--light-border
dwmth-box--no-top-border">
<li class="">
<button
*ngIf="!optionsHasValue && !option.allowInput"
[tabindex]="0"
class="
dwmth-box
dwmth-box--no-margin
dwmth-box--no-border
option
relative"
class="targeting-select__option"
(click)="handleOptionClick(option)"
data-test="common-targeting-select-option"
>
<span
class="
dwmth-copy
dwmth-copy--x-dark
dwmth-copy--semi"
data-test="common-targeting-select-option-label"
>
data-test="common-targeting-select-option">
{{ option.label }}
</span>

<img
class="go-to-category"
class="targeting-select__option-arrow"
src="/assets/images/chevron--right.svg"
alt="Go to category"
>
alt="">
</button>

<app-targeting-custom-option-input
*ngIf="option.allowInput"
[option]="option"
Expand All @@ -85,23 +53,9 @@
<button
*ngIf="optionsHasValue"
[tabindex]="0"
class="
dwmth-box
dwmth-box--no-margin
dwmth-box--no-border
dwmth-box--no-top-border
option
relative"
(click)="toggleItem(option)"
>
<span
class="
dwmth-copy
dwmth-copy--x-dark
dwmth-copy--semi"
>
class="targeting-select__option"
(click)="toggleItem(option)">
{{ option.label }}
</span>
<span [ngClass]="{'input-valid': option.selected}"
class="checkmark-unselected"
></span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
@import '../../../../../styles.scss';

button {
width: 100%;
display: flex;
align-items: center;

&:focus {
background-color: darken(pal(gray, extreme-light), 1%);
.targeting-select {
&__input {
@include input($max-width: initial);
width: 100%;
}
}

.inactive {
display: inline-block;
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid pal(gray, mid-light);
position: absolute;
margin-right: 10px;
top: 7px;
right: 4px;
}

.search-icon {
top: 15px;
right: 15px;
}
&__input-icon {
margin-right: 10px;
}

.go-to-category {
position: absolute;
top: 10px;
right: 20px;
}
&__search-icon,
&__option-arrow {
position: absolute;
top: 13px;
right: 20px;
}

.parent-option {
@include font(14, normal);
&__search-icon {
top: 15px;
}

&-box {
padding: 6px 15px;
&__option {
@include container(
$border-color: pal(gray, light),
$padding-vertical: 8px,
$padding-horizontal: 15px,
$margin-top: 0
);
@include copy(
$color: pal(navy, light),
$font-weight: semi);
border-top: none;
cursor: pointer;
position: relative;
width: 100%;
display: flex;
align-items: center;

&:hover,
&:focus {
background-color: darken(pal(gray, extreme-light), 1%);
transition: background-color 0.2s ease;
cursor: pointer;
}

&--back {
padding: 6px 15px;
}
}
}

.option {
&:hover {
background-color: darken(pal(gray, extreme-light), 1%);
transition: background-color 0.2s ease;
cursor: pointer;
&__parent-option {
@include copy($font-size: 14)
}
}

.targeting-custom-option {
display: flex;
}
2 changes: 1 addition & 1 deletion src/app/common/pipes/adshares-token.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class AdsharesTokenPipe implements PipeTransform {
code = format !== 'symbol' ? environment.currencySymbol : '';
}

return `${symbol} ${formatMoney(removeDecimalPart(value), precision)} ${code}`;
return `${symbol}${formatMoney(removeDecimalPart(value), precision)} ${code}`;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<h1 class="user-wallet__funds"
data-test="user-total-funds"
>
{{ wallet.walletBalance | formatMoney:11:crypto:code }}
{{ wallet.walletBalance > 0 ? (wallet.walletBalance | formatMoney:11:crypto:code) :
(wallet.walletBalance | formatMoney:2:crypto:code) }}
</h1>

<div class="user-wallet__funds-actions">
Expand Down Expand Up @@ -71,8 +72,8 @@ <h2 class="user-wallet__title">
You can spend your bonus funds on advertising but you can't withdraw them.
</p>
<p
class="user-wallet__funds-in-currency"
data-test="bonus-funds-in-currency">
class="user-wallet__funds-in-currency"
data-test="bonus-funds-in-currency">
{{ wallet.bonusBalance | calculateInCurrency:2 }}
</p>
<strong class="user-wallet__funds"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
flex-wrap: wrap;

&__wallet-box {
@include container(20px, 20px);
@include container(20px, 20px,
$border-color: pal(gray, nearly-white)
);
min-width: 450px;
flex: 1;
&--with-margin {
Expand Down
10 changes: 5 additions & 5 deletions src/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
$padding-horizontal: 8px,
$padding-vertical: 8px,
$background-color: pal(white),
$border-color: pal(gray, nearly-white),
$border-color: pal(white),
$margin-top: 2px,
$margin-bottom: 0,
$border-width: 1px
) {
border-radius: 2px;
background-color: $background-color;
border: $border-width solid $background-color;
border: $border-width solid $border-color;
padding: $padding-vertical $padding-horizontal;
margin-top: $margin-top;
margin-bottom: $margin-bottom;

& + & {
& > & {
border: none;
}
}
Expand Down Expand Up @@ -86,13 +86,13 @@
}
}

@mixin input() {
@mixin input($max-width: 320px) {
@include font(16, medium);
border-radius: 2px;
background-color: #f8f9fc;
border: solid 1px pal(gray, light);
padding: 12px 13px 12px 18px;
max-width: 320px;
max-width: $max-width;
}

@mixin label(
Expand Down

0 comments on commit 19e8db1

Please sign in to comment.