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

Add shrink button to the right section #665

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
1 change: 1 addition & 0 deletions src/assets/iconExpanded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 112 additions & 47 deletions src/components/layout/RightSection.vue
Original file line number Diff line number Diff line change
@@ -1,63 +1,99 @@
<template>
<div class="app__rightcolumn">
<div class="content">
<div :class="['content', { iframe: useIframeWallet }]">
<SearchInput class="side-search" />

<iframe
v-if="useIframeWallet"
class="wallet-frame"
:src="walletUrl"
/>
<div
v-else-if="isLoggedIn"
class="section wallet-install"
>
<div class="section wallet-install">
<div class="section__title">
<img src="../../assets/iconWallet.svg">
{{ $t('components.layout.RightSection.Wallet') }}
<div class="account">
{{ account }}
<div>
<img src="../../assets/iconWallet.svg">
{{ $t('components.layout.RightSection.Wallet') }}
</div>
</div>
<div class="section__body">
<div
class="balance text-ellipsis"
:title="roundAE + ' AE'"
v-if="useIframeWallet"
@click="showTrending = !showTrending"
>
<AeAmount :amount="balance" />
<img
:class="{ rotate: showTrending }"
src="../../assets/iconExpanded.svg"
>
</div>
<div class="choose-fiat">
<Dropdown
v-if="currencyDropdownOptions"
:options="currencyDropdownOptions"
:method="selectCurrency"
:selected="settings.currency"
/>
<div
v-else-if="isLoggedIn"
class="account"
>
{{ account }}
</div>
</div>
<div class="section__body">
<template v-if="useIframeWallet">
<transition
name="component-fade"
appear
mode="out-in"
>
<iframe
:class="['wallet-frame', { shrink: showTrending }]"
:src="walletUrl"
/>
</transition>
</template>
<template v-else-if="isLoggedIn">
<div
class="balance text-ellipsis"
:title="roundAE + ' AE'"
>
<AeAmount :amount="balance" />
</div>
<div class="choose-fiat">
<Dropdown
v-if="currencyDropdownOptions"
:options="currencyDropdownOptions"
:method="selectCurrency"
:selected="settings.currency"
/>
</div>
</template>
</div>
</div>

<div class="section trending">
<div class="section__title">
<img src="../../assets/iconTrending.svg">
{{ $t('components.layout.RightSection.Trending') }}
<div>
<img src="../../assets/iconTrending.svg">
{{ $t('components.layout.RightSection.Trending') }}
</div>
<div
v-if="useIframeWallet"
@click="showTrending = !showTrending"
>
<img
:class="{ rotate: !showTrending }"
src="../../assets/iconExpanded.svg"
>
</div>
</div>
<div
v-if="!loading.tips"
class="section__body topics-section"
:class="{ active: topics && topics.length > 0 }"
<transition
name="component-fade"
appear
mode="out-in"
>
<div
v-for="([topic, data], idx) in topics.length && topics.filter(([t]) => t !== '#test')"
:key="idx"
class="section__item"
v-if="!loading.tips && (showTrending || (isLoggedIn && !useIframeWallet))"
class="section__body topics-section"
:class="{ active: topics && topics.length > 0 }"
>
<div class="topic-container text-ellipsis">
<Topic :topic="topic" />
<div
v-for="([topic, data], idx) in topics.length && topics.filter(([t]) => t !== '#test')"
:key="idx"
class="section__item"
>
<div class="topic-container text-ellipsis">
<Topic :topic="topic" />
</div>
<AeAmountFiat :amount="data.amount" />
</div>
<AeAmountFiat :amount="data.amount" />
</div>
</div>
</transition>
</div>

<FooterSection />
Expand Down Expand Up @@ -87,6 +123,7 @@ export default {
},
data: () => ({
walletUrl: process.env.VUE_APP_WALLET_URL,
showTrending: false,
}),
computed: {
...mapGetters(['isLoggedIn']),
Expand Down Expand Up @@ -133,6 +170,29 @@ export default {
.content {
max-width: 18rem;

&.iframe .section {
.section__title {
display: flex;
justify-content: space-between;

> div {
display: inline-block;

&:hover {
filter: brightness(1.3);
}

.rotate {
transform: rotate(180deg);
}
}
}

&.wallet-install .section__body {
padding: 0;
}
}

.section {
background-color: $article_content_color;
border-radius: 0.5rem;
Expand Down Expand Up @@ -197,18 +257,23 @@ export default {
}
}

.wallet-frame {
border: none;
width: 100%;
height: 657px;
}

.wallet-install {
margin-bottom: 0.5rem;
max-height: 400px;
transition: max-height 0.25s ease-in, opacity 0.25s ease-in;
display: block;

.wallet-frame {
width: 350px;
height: 470px;
max-height: 470px;
max-width: 350px;
border: none;

&.shrink {
height: 150px;
}
}

.account {
color: $light_font_color;
font-size: 0.52rem;
Expand Down