Skip to content

Commit 140c5c4

Browse files
committed
Replace New things section with a banner
1 parent f71c33c commit 140c5c4

4 files changed

Lines changed: 45 additions & 10 deletions

File tree

components/ActionBar.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import Button from "@/components/ui/Button.vue"
77
/** Components */
88
import Search from "@/components/modules/navigation/Search.vue"
99
10+
/** Utils */
11+
import { isMobile } from "@/services/utils"
12+
1013
/** Store */
1114
import { useAppStore } from "@/store/app"
1215
const appStore = useAppStore()
@@ -15,7 +18,7 @@ const appStore = useAppStore()
1518
<template>
1619
<Flex wide align="center" justify="between" gap="24" :class="$style.wrapper">
1720
<Flex wide align="center" gap="12">
18-
<Button @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
21+
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
1922
<Icon name="menu" size="16" color="primary" />
2023
</Button>
2124

components/LeftSidebar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const handleNavigate = (url) => {
217217
</Flex>
218218
</Flex>
219219

220-
<Flex direction="column" gap="8">
220+
<!-- <Flex direction="column" gap="8">
221221
<Flex align="center" gap="8" style="padding: 0 8px">
222222
<Icon name="stars" size="12" color="tertiary" />
223223
<Text size="12" weight="500" color="tertiary">New things</Text>
@@ -226,9 +226,9 @@ const handleNavigate = (url) => {
226226
<Flex direction="column" gap="2">
227227
<NavLink v-for="link in newLinks" :link="link" @onClose="appStore.showSidebar = false" />
228228
</Flex>
229-
</Flex>
229+
</Flex> -->
230230

231-
<AdvBanner />
231+
<AdvBanner :style="{ width: '100%' }" />
232232
</Flex>
233233

234234
<Flex direction="column" gap="16" style="margin-right: 20px">

components/shared/AdvBanner.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
/** Services */
33
import { getAdvByName, getRandomAdv } from "@/services/constants/advertising"
44
5+
/** Store */
6+
import { useModalsStore } from "~/store/modals"
7+
const modalsStore = useModalsStore()
8+
59
const props = defineProps({
610
advName: {
711
type: String,
@@ -16,6 +20,14 @@ const props = defineProps({
1620
const adv = ref({})
1721
const isDisplayed = ref(true)
1822
23+
const handleClick = () => {
24+
if (adv.value.link) {
25+
window.open(adv.value.link, '_blank')
26+
} else if (adv.value.modal) {
27+
modalsStore.open(adv.value.modal)
28+
}
29+
}
30+
1931
onMounted(() => {
2032
if (props.advName) {
2133
adv.value = getAdvByName(props.advName)
@@ -26,7 +38,7 @@ onMounted(() => {
2638
</script>
2739

2840
<template>
29-
<NuxtLink v-if="adv.link" :to="adv.link" target="_blank" :class="[orientation === 'horizontal' && $style.wrapper_horizontal, !isDisplayed && $style.not_display]">
41+
<Flex v-if="adv.name" @click="handleClick()" :class="[$style.wrapper, orientation === 'horizontal' && $style.wrapper_horizontal, !isDisplayed && $style.not_display]">
3042
<Flex v-if="orientation === 'vertical'" direction="column" gap="12" :class="$style.ad_vertical">
3143
<Flex direction="column" gap="8">
3244
<Flex align="center" gap="6">
@@ -37,7 +49,6 @@ onMounted(() => {
3749
<Text size="13" weight="600" color="tertiary" height="140"> {{ adv.body }} </Text>
3850
</Flex>
3951

40-
<!-- <Text size="13" weight="600" color="brand" :class="$style.footer"> {{ adv.footer }} </Text> -->
4152
<Flex align="center" justify="between">
4253
<Text size="13" weight="600" color="brand" :class="$style.footer"> {{ adv.footer }} </Text>
4354

@@ -67,10 +78,16 @@ onMounted(() => {
6778
<Icon @click.prevent.stop="isDisplayed = false" name="close" size="16" color="secondary" :class="$style.close_icon" />
6879
</Flex>
6980
</Flex>
70-
</NuxtLink>
81+
</Flex>
7182
</template>
7283

7384
<style module>
85+
.wrapper {
86+
width: 100%;
87+
88+
cursor: pointer;
89+
}
90+
7491
.wrapper_horizontal {
7592
width: 100%;
7693
padding: 8px 24px 0px 24px;
@@ -149,4 +166,10 @@ onMounted(() => {
149166
}
150167
}
151168
}
169+
170+
@media (max-width: 500px) {
171+
.wrapper_horizontal {
172+
padding: 12px;
173+
}
174+
}
152175
</style>

services/constants/advertising.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const advertisements = [
22
{
33
name: 'celenium_api',
4-
link: 'https://api-plans.celenium.io',
4+
modal: 'api',
55
icon: 'slash',
66
header: 'Try out Celenium API',
77
body: 'The power of Celestia: Scalable, Secure and Modular Blockchain.',
88
footer: 'Get started',
9-
weight: 0.5,
9+
weight: 0.2,
1010
},
1111
{
1212
name: 'celenium_survey',
@@ -15,7 +15,16 @@ const advertisements = [
1515
header: 'Celenium survey',
1616
body: 'Please take 5 minutes and answer a few questions.',
1717
footer: 'Take the survey',
18-
weight: 0.5,
18+
weight: 0.4,
19+
},
20+
{
21+
name: 'lumina',
22+
modal: 'lightNode',
23+
icon: 'lumina',
24+
header: 'Your Own Node',
25+
body: 'Launch a node directly in your browser or on your phone.',
26+
footer: 'Run Light Node',
27+
weight: 0.4,
1928
},
2029
]
2130

0 commit comments

Comments
 (0)