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

fix: several MyKiva UI fixes #5674

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
24 changes: 17 additions & 7 deletions src/components/MyKiva/BadgesSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<span class="tw-text-base !tw-font-medium tw-text-center tw-mb-1">
{{ badge.challengeName }}
</span>
<div
class="tw-p-1"
:class="{
'tw-grayscale': !badge.hasStarted
}"
style="height: 148px;"
<BadgeContainer
:status="getBadgeStatus(badge)"
:shape="getBadgeShape(badge.id)"
class="tw-self-start tw-mx-auto"
style="height: 133px;"
>
<img
:src="getActiveTierData(badge).imageUrl"
:alt="badge.challengeName"
class="tw-h-full tw-mx-auto"
>
</div>
</BadgeContainer>
<div class="tw-flex tw-flex-col tw-gap-0.5 tw-font-medium tw-grow">
<span
v-if="badge.hasStarted"
Expand All @@ -54,6 +54,8 @@ import { computed } from 'vue';
import { defaultBadges } from '#src/util/achievementUtils';
import { indexIn } from '#src/util/comparators';
import useBadgeData from '#src/composables/useBadgeData';
import { getBadgeShape, BADGE_COMPLETED, BADGE_IN_PROGRESS } from '#src/composables/useBadgeModal';
import BadgeContainer from './BadgeContainer';

defineEmits(['badge-clicked']);

Expand All @@ -75,6 +77,14 @@ const visibleBadges = computed(() => {
const levelCaption = badge => {
return `Level ${getActiveTierData(badge).level}/${getBadgeWithVisibleTiers(badge).achievementData.tiers.length}`;
};

const getBadgeStatus = badge => {
const activeTier = getActiveTierData(badge);
if (activeTier?.level === badge?.achievementData?.tiers?.length) {
dyersituations marked this conversation as resolved.
Show resolved Hide resolved
return BADGE_COMPLETED;
}
return BADGE_IN_PROGRESS;
};
</script>

<style lang="postcss" scoped>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MyKiva/MyKivaHero.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="tw-w-full landscape tw-relative">
<MyKivaContainer>
<div class="tw-bg-white tw-rounded-b tw-absolute tw-top-0 tw-px-1.5 tw-py-2">
<div class="tw-bg-white tw-rounded-b tw-absolute tw-top-0 tw-p-1.5">
<h3>Welcome back 👋</h3>
<div
v-if="isBorrower || isTrustee"
Expand Down Expand Up @@ -37,7 +37,7 @@
@click="$emit('show-navigation')"
>
<kv-material-icon
class="tw-absolute tw-right-0 tw-bg-white tw-p-0.5 tw-rounded-full tw-mt-2 tw-shadow-lg"
class="tw-absolute tw-right-0 tw-bg-white tw-p-0.5 tw-rounded-full tw-shadow-lg tw-top-1"
name="settings"
:icon="mdiCogOutline"
/>
Expand Down
Loading