Skip to content

Commit

Permalink
fix: change component to take in a slot
Browse files Browse the repository at this point in the history
  • Loading branch information
michelleinez committed Jan 19, 2024
1 parent cedc03c commit a3b733c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 72 deletions.
24 changes: 0 additions & 24 deletions @kiva/kv-components/vue/KvVotingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,10 @@ export default {
type: String,
default: '',
},
aspectRatio: {
type: Number,
default: 1,
},
hash: {
type: String,
default: '',
},
images: {
type: Array,
default: () => [],
},
photoPath: {
type: String,
default: '',
},
defaultImage: {
type: Object,
default: () => ({ width: 300 }),
},
percentage: {
type: Number,
default: 0,
Expand All @@ -115,14 +99,6 @@ export default {
type: Boolean,
default: true,
},
useDirectUrl: {
type: Boolean,
default: false,
},
directImageUrl: {
type: String,
default: '',
},
},
setup() {
const mapMarkerIcon = computed(() => mdiMapMarker);
Expand Down
48 changes: 0 additions & 48 deletions @kiva/kv-components/vue/stories/KvVotingCard.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import KvVotingCard from '../KvVotingCard.vue';
import KvBorrowerImage from '../KvBorrowerImage.vue';

export default {
title: 'KvVotingCard',
Expand Down Expand Up @@ -32,50 +31,3 @@ Default.args = {
percentage: 45,
showVoteButton: true,
};

// Variant story with the KvBorrowerImage component
export const WithBorrowerImage = Template.bind({});
WithBorrowerImage.args = {
borrowerName: 'Jacqueline',
country: 'Rwanda',
category: 'Women-owned retail businesses',
aspectRatio: 0.75,
hash: '9673d0722a7675b9b8d11f90849d9b44',
images: [
{ width: 336, viewSize: 1024 },
{ width: 336, viewSize: 768 },
{ width: 416, viewSize: 480 },
{ width: 374, viewSize: 414 },
{ width: 335, viewSize: 375 },
{ width: 300 },
],
photoPath: 'https://www-kiva-org.freetls.fastly.net/img/',
defaultImage: { width: 300 },
percentage: 45,
showVoteButton: true,
};

WithBorrowerImage.decorators = [
(Story, context) => {
const { args } = context;
return {
components: { KvVotingCard, KvBorrowerImage },
props: args,
template: `
<kv-voting-card v-bind="$props">
<template #image>
<kv-borrower-image
class="tw-rounded"
:alt="'Photo of ' + $props.borrowerName"
:aspect-ratio="$props.aspectRatio"
:default-image="$props.defaultImage"
:hash="$props.hash"
:images="$props.images"
:photo-path="$props.photoPath"
/>
</template>
</kv-voting-card>
`,
};
},
];

0 comments on commit a3b733c

Please sign in to comment.