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: Order the Card #360

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions .env.example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't delete this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't delete it just renamed it to .env

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't rename it. you should copy it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you see in this pull request, it shows that you deleted this file. revert this change.

This file was deleted.

51 changes: 51 additions & 0 deletions components/TOrderButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<div>
<p :class="textClass">200 Free Cards Left</p>
<button type="button" :class="buttonClass">
<a href="https://wedance.gumroad.com/l/vip-card">Get Free VIP Card</a>
</button>
</div>
</template>

<script>
export default {
data() {
return {
buttonClass: 'button',
textClass: 'text',
}
},
}
</script>

<style>
.text {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use inline styles. Use Tailwind classes. See how other components are done. Do it similar.

font-size: 1.5em;
text-align: center;
}
.button {
background-color: black;
border: none;
color: white;
padding: 13px 200px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 3px 4px 20px;
cursor: pointer;
border-radius: 20px;
}

@media screen and (max-width: 600px) {
.text {
font-size: 1em;
text-align: center;
}
.button {
padding: 10px 100px;
margin: 20px 20px 15px 60px;
font-size: 10px;
}
}
</style>
34 changes: 11 additions & 23 deletions components/TProfile.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div>
<template v-if="!uid"><TOrderButton /></template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not an order button. Think more abstract.
It's a banner. It functionality should be similar to WTeaser.

<THeader>
<TButton
v-if="profile.type === 'City'"
Expand Down Expand Up @@ -90,12 +91,6 @@
</div>

<div v-if="profile.type === 'City'" class="flex space-x-2 mt-4">
<TButton
to="/events/-/edit"
type="primary"
icon="plus"
label="Add Event"
/>
<TReaction
:label="$t('Subscribe')"
:toggled-label="$t('Unsubscribe')"
Expand Down Expand Up @@ -143,6 +138,11 @@
class="w-full mt-4"
/>

<TCommunity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you rebase your code on top of main branch.
This code change has nothing to do with your task. Make sure you don't break things.

v-if="profile.type === 'City' && profile.username !== 'Travel'"
class="pt-4 border-t"
/>

<template v-if="$route.query.beta">
<TCalendar
v-if="profile.type === 'City' && profile.username !== 'Travel'"
Expand All @@ -151,21 +151,14 @@
</template>

<template v-if="!$route.query.beta">
<TLoader v-if="!loaded" class="py-4" />
<TEventListNoLoad
v-else
:community="profile.username"
:username="profile.username"
:docs="events"
class="w-full border-b border-t pt-4"
/>
</template>

<TCommunity
v-if="profile.type === 'City' && profile.username !== 'Travel'"
class="pt-4 border-t"
/>

<WTeaser
v-if="!uid && profile.type !== 'City' && profile.place"
:title="$t('profile.invite.header', { count: invitesLeft })"
Expand Down Expand Up @@ -286,6 +279,7 @@

<script>
import { computed, onMounted, ref } from 'vue-demi'
import TOrderButton from './TOrderButton.vue'
import { useApp } from '~/use/app'
import { useAuth } from '~/use/auth'
import { useProfiles } from '~/use/profiles'
Expand All @@ -302,6 +296,9 @@ import {
import { useCities } from '~/use/cities'

export default {
components: {
TOrderButton,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nuxt is doing auto-import of components. No need to define components, they are already available.

},
props: {
profile: {
type: Object,
Expand All @@ -311,7 +308,7 @@ export default {
head() {
return getMeta('profiles', this.profile)
},
setup(props, { root }) {
setup(props) {
const internationalChatLink = 'https://t.me/+Vxw15sDG-dWpqHDj'
const { uid, isAdmin, can } = useAuth()
const { profileFields } = useProfiles()
Expand Down Expand Up @@ -357,17 +354,12 @@ export default {
intro.visible = true
}
}

const events = ref([])
const loaded = ref(false)

const subscribersCount = computed(() => {
return props.profile?.watch?.count || 0
})

onMounted(async () => {
let result = []

if (props.profile.username === 'Travel') {
result = await getFestivals()
} else if (props.profile.type === 'City') {
Expand All @@ -391,15 +383,11 @@ export default {
),
]
}

events.value = result
loaded.value = true
})

return {
internationalChatLink,
intro,
loaded,
uid,
can,
getExcerpt,
Expand Down