Skip to content

fix: update computed props to hide missing profile details and add job title #259

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

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 packages/frontendmu-data/data/speakers-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"bio": "Front-End Engineer | Streamer (Twitch)",
"job_title": "Senior Front-end Engineer @ Livestorm",
"location": "Mauritius",
"website": "",
"github": "cedpoilly",
"twitter": ""
}
Expand Down
15 changes: 10 additions & 5 deletions packages/frontendmu-nuxt/components/speaker/Single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ const person = computed(() => props.speaker.person)
const sessions = computed(() => props.speaker.sessions)

const profile = computed(() => props.speaker.profile)
const hasProfileBio = computed(() => profile.value.bio !== '')
const hasProfileLocation = computed(() => profile.value.location !== '')
const hasProfileWebsite = computed(() => profile.value.website !== '')
const hasProfileGithub = computed(() => profile.value.github !== '')
const hasProfileTwitter = computed(() => profile.value.twitter !== '')
const hasProfileBio = computed(() => profile.value.bio && profile.value.bio !== '')
const hasProfileJobTitle = computed(() => profile.value.job_title && profile.value.job_title !== '')
const hasProfileLocation = computed(() => profile.value.location && profile.value.location !== '')
const hasProfileWebsite = computed(() => profile.value.website && profile.value.website !== '')
const hasProfileGithub = computed(() => profile.value.github && profile.value.github !== '')
const hasProfileTwitter = computed(() => profile.value.twitter && profile.value.twitter !== '')

const speaker_photo = getGithubUrl(person.value.github_account)
</script>
Expand Down Expand Up @@ -94,6 +95,10 @@ const speaker_photo = getGithubUrl(person.value.github_account)
</p>

<nav class="grid gap-2 *:flex *:justify-start *:items-center *:gap-2">
<span v-if="hasProfileJobTitle">
<Icon name="lucide:code-xml" mode="svg" class="size-6" />{{ profile.job_title }}
</span>

<span v-if="hasProfileLocation">
<Icon name="lucide:map-pin" mode="svg" class="size-6" />{{ profile.location }}
</span>
Expand Down
Loading