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

Feat/banner #93

Merged
merged 2 commits into from
Apr 10, 2024
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
96 changes: 96 additions & 0 deletions components/header/Banner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<template>
<div class="banner max-w-[100vw] md:max-w-[700px]">
<swiper
:spaceBetween="30"
:centeredSlides="true"
:autoplay="{
delay: 2500,
disableOnInteraction: false,
}"
:pagination="{
clickable: true,
}"
:navigation="true"
:modules="modules"
class="mySwiper"
>
<swiper-slide>
<!-- <div>
<img src="/img/banner.svg" class="m-auto hidden md:block" />
<img src="/img/mobile.svg" class="m-auto block md:hidden" />
</div> -->

<a href="https://app.zklink.io/" target="\_blank">
<img src="/img/banner.svg" className="bannerImg" />
<img src="/img/mobile.svg" className="mobileImg" />
</a>
</swiper-slide>
<swiper-slide>
<a href="https://zklink.io/merge" target="\_blank">
<img src="/img/portal-banner.png" className="bannerImg" />
<img src="/img/portal-banner-mobile.png" className="mobileImg" />
</a>
</swiper-slide>
</swiper>
</div>
</template>
<script>
// Import Swiper Vue.js components
import { Swiper, SwiperSlide } from "swiper/vue";

Check failure on line 39 in components/header/Banner.vue

View workflow job for this annotation

GitHub Actions / Build

There should be no empty line within import group

// Import Swiper styles
import "swiper/css";

// import "swiper/css/pagination";
// import "swiper/css/navigation";

// import required modules
import { Autoplay, Pagination, Navigation } from "swiper/modules";

Check failure on line 48 in components/header/Banner.vue

View workflow job for this annotation

GitHub Actions / Build

`swiper/modules` import should occur before import of `swiper/vue`

export default {
components: {
Swiper,
SwiperSlide,
},
setup() {
return {
modules: [Autoplay, Pagination, Navigation],
};
},
};
</script>

<style scoped lang="scss">
/* @import "swiper/css"; */
.banner {
margin: 0 auto;
overflow: auto;
width: 100%;
text-align: center;
a {
display: block;
width: 100%;
min-width: 0px;
max-width: 700px;
}
.bannerImg {
display: block;
width: 100%;
height: 80px;
}
.mobileImg {
display: none;
}
@media screen and (max-width: 640px) {
.bannerImg {
display: none;
}
.mobileImg {
display: none;
display: block;
width: 100%;
height: 80px;
}
}
}
</style>
23 changes: 14 additions & 9 deletions components/header/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@
<CommonButton class="hamburger-icon" @click="mobileMainNavigationOpened = true">
<Bars3Icon class="h-6 w-6" aria-hidden="true" />
<transition v-bind="TransitionOpacity()">
<CommonBadge v-if="withdrawalsAvailableForClaiming && withdrawalsAvailableForClaiming.length" class="action-available-badge">
<CommonBadge
v-if="withdrawalsAvailableForClaiming && withdrawalsAvailableForClaiming.length"
class="action-available-badge"
>
{{ withdrawalsAvailableForClaiming.length }}
</CommonBadge>
</transition>
Expand Down Expand Up @@ -103,7 +106,7 @@
<div>Note: Withdrawals will be enabled before 04/13/2024</div>
</div> -->
<div className="banner" v-if="!route.query.s || route.query.s !== 'okx'">
<a href="https://app.zklink.io/" target="\_blank">
<!-- <a href="https://app.zklink.io/" target="\_blank">
<img
src="/img/banner.svg"
alt=""
Expand All @@ -114,7 +117,8 @@
alt=""
className="mobileImg"
/>
</a>
</a> -->
<banner />
</div>
</div>
</template>
Expand All @@ -138,6 +142,7 @@
import { useOnboardStore } from "@/store/onboard";
import { useZkSyncWithdrawalsStore } from "@/store/zksync/withdrawals";
import useNetworks from "@/composables/useNetworks";
import Banner from "./Banner.vue";
const { defaultNetwork, isMainnet } = useNetworks();

const route = useRoute();
Expand All @@ -158,7 +163,7 @@

const { selectedColorMode, switchColorMode } = useColorMode();
const isShowFaucet = computed(() => defaultNetwork.id === 810182);
</script>

Check failure on line 166 in components/header/Header.vue

View workflow job for this annotation

GitHub Actions / Build

'computed' is not defined

<style lang="scss" scoped>
.header {
Expand Down Expand Up @@ -217,28 +222,28 @@
height: 18px;
}
}
.banner{
.banner {
width: 100%;
text-align: center;
a{
a {
display: inline-block;
width: 100%;
min-width: 0px;
max-width: 700px;
}
.bannerImg{
.bannerImg {
display: inline-block;
width: 100%;
height: 80px;
}
.mobileImg{
.mobileImg {
display: none;
}
@media screen and (max-width: 640px) {
.bannerImg{
.bannerImg {
display: none;
}
.mobileImg{
.mobileImg {
display: none;
display: inline-block;
width: 100%;
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"ofetch": "^1.3.3",
"pinia": "^2.0.33",
"sass": "^1.57.1",
"swiper": "^11.1.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.5",
"viem": "^2.9.5",
Expand Down
Binary file added public/img/portal-banner-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/portal-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion views/transactions/Deposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ const makeTransaction = async () => {
to: transaction.value!.to.address,
tokenAddress: transaction.value!.token.address,
amount: transaction.value!.token.amount,
toMerge: transaction.value!.toMerge,
toMerge: mergeSupported.value && transaction.value!.toMerge,
},
feeValues.value!
);
Expand Down
Loading