diff --git a/.storybook/stories/JournalUpdateCard.stories.js b/.storybook/stories/JournalUpdateCard.stories.js new file mode 100644 index 0000000000..2aeefbb3e0 --- /dev/null +++ b/.storybook/stories/JournalUpdateCard.stories.js @@ -0,0 +1,63 @@ +import JournalUpdateCard from '#src/components/MyKiva/JournalUpdateCard.vue'; +import { mockLoansArray } from '../utils'; +import apolloStoryMixin from '../mixins/apollo-story-mixin'; +import cookieStoreStoryMixin from "../mixins/cookie-store-story-mixin"; + +export default { + title: 'MyKiva/JournalUpdateCard', + component: JournalUpdateCard, +}; + +const mockLoans = mockLoansArray(1); + +const update = { + "id": 1365244, + "body": "I’m thrilled to update you on our progress! Thanks to your support, we’ve entered the next phase of our journey—choosing the perfect fabric for our new bust-friendly styles. The swatches are on their way, and we’re evaluating two amazing options:
\r\n
\r\nCotton Spandex Jersey
\r\nBamboo Viscose Spandex
\r\n
\r\nBoth fabrics are not only comfortable and functional, but they are also natural and better for the environment. Choosing natural fabrics like cotton and bamboo is important to us because they are biodegradable, unlike synthetic materials that contribute to long-term pollution. Additionally, natural fabrics require fewer chemicals in their production, and bamboo in particular grows rapidly without the need for pesticides, making it a more sustainable option.
\r\n
\r\nWe prioritize breathability and comfort, but also want to do our part in reducing the fashion industry’s environmental footprint. By choosing natural fabrics, we’re working toward creating sustainable, eco-friendly clothing that looks good, feels good, and is better for the planet.
\r\n
\r\nThank you once again for your belief in our mission and for your support in helping us bring these new styles to life. I’ll keep you updated on our final choice, and as always, we are grateful for your continued support!
\r\n
\r\nWarm regards,
\r\nKristen Allen
\r\nFounder, Exclusively Kristen", + "subject": "Exciting Update: Fabric Swatches Are on the Way!", + "date": "2024-09-21T11:37:31Z", + "image": null +}; + +const lender = { + id: 1017469, + public: true, + inviterName: 'Test User', +}; + +const story = (args = {}) => { + const template = (_args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { JournalUpdateCard }, + mixins: [apolloStoryMixin(), cookieStoreStoryMixin()], + setup() { return { args }; }, + provide: { + $kvTrackEvent: () => Promise.resolve({ + fn: () => ({}), + }), + }, + template: ` +
+ +
+ `, + methods: { + onReadMoreClicked(updateId) { + console.log(updateId); + }, + onShareLoanClicked() { + console.log('share loan clicked'); + }, + }, + }); + template.args = args; + return template; +}; + +export const Default = story({ loan: mockLoans[0], update, lender }); +export const Repaying = story({ loan: { ...mockLoans[0], status: 'payingBack' }, update, lender }); +export const UpdateNumber = story({ loan: mockLoans[0], update, updateNumber: '2', lender }); +export const NotTruncatedBody = story({ loan: { ...mockLoans[0], status: 'payingBack' }, update: { ...update, body: 'Testing not truncated body feature.' }, lender}); diff --git a/.storybook/stories/JournalUpdatesCarousel.stories.js b/.storybook/stories/JournalUpdatesCarousel.stories.js new file mode 100644 index 0000000000..70c9d53244 --- /dev/null +++ b/.storybook/stories/JournalUpdatesCarousel.stories.js @@ -0,0 +1,75 @@ +import JournalUpdatesCarousel from '#src/components/MyKiva/JournalUpdatesCarousel.vue'; +import { mockLoansArray } from '../utils'; +import apolloStoryMixin from '../mixins/apollo-story-mixin'; +import cookieStoreStoryMixin from "../mixins/cookie-store-story-mixin"; + +export default { + title: 'MyKiva/JournalUpdatesCarousel', + component: JournalUpdatesCarousel, +}; + +const mockLoans = mockLoansArray(1); + +const updates = [ + { + "id": 1366971, + "body": "Dear Kiva lenders,
\r\n
\r\nWe’re thrilled to update you on our progress and express our gratitude for your continued support! Thanks to your generous contributions, the fabric samples for our new bust-friendly styles have just arrived, and we’re excited to begin the next phase of our journey.
\r\n
\r\nOur team is meticulously reviewing each fabric to ensure it meets our high standards for durability, breathability, and overall quality. While some of the fabrics are perfect, a few have turned out to be much too thin for our needs. We’re carefully evaluating every option to ensure that the final product will be both comfortable and long-lasting.
\r\n
\r\nThank you again for believing in our mission to bring more body-inclusive, eco-friendly fashion to the world. We couldn’t do this without you, and we’ll keep you updated on the next steps!
\r\n
\r\nWarm regards,
\r\nKristen", + "subject": "Thank You for Your Support: Fabric Has Arrived!", + "date": "2024-09-25T15:00:09Z", + "image": { + "id": 5680766, + "url": "https://www-0.development.kiva.org/img/w200h200/bd5e2740a161233c37d0781fea0c5653.jpg" + } + }, + { + "id": 1365244, + "body": "I’m thrilled to update you on our progress! Thanks to your support, we’ve entered the next phase of our journey—choosing the perfect fabric for our new bust-friendly styles. The swatches are on their way, and we’re evaluating two amazing options:
\r\n
\r\nCotton Spandex Jersey
\r\nBamboo Viscose Spandex
\r\n
\r\nBoth fabrics are not only comfortable and functional, but they are also natural and better for the environment. Choosing natural fabrics like cotton and bamboo is important to us because they are biodegradable, unlike synthetic materials that contribute to long-term pollution. Additionally, natural fabrics require fewer chemicals in their production, and bamboo in particular grows rapidly without the need for pesticides, making it a more sustainable option.
\r\n
\r\nWe prioritize breathability and comfort, but also want to do our part in reducing the fashion industry’s environmental footprint. By choosing natural fabrics, we’re working toward creating sustainable, eco-friendly clothing that looks good, feels good, and is better for the planet.
\r\n
\r\nThank you once again for your belief in our mission and for your support in helping us bring these new styles to life. I’ll keep you updated on our final choice, and as always, we are grateful for your continued support!
\r\n
\r\nWarm regards,
\r\nKristen Allen
\r\nFounder, Exclusively Kristen", + "subject": "Exciting Update: Fabric Swatches Are on the Way!", + "date": "2024-09-21T11:37:31Z", + "image": null + }, + { + "id": 1364885, + "body": "Thank you, I am feeling so appreciative! And thanks to all lenders who have contributed in the last couple days to get us over 22% - very exciting! I am so very grateful to this community of lenders. Thank you for helping make our dream come true. We are at the final stretch with just one day to go. Please share my loan with your network and remind them it's a loan, not a donation. I plan to pay all of you back!", + "subject": "Freeling Grateful!", + "date": "2024-09-17T16:15:28Z", + "image": null + }, + { + "id": 1364834, + "body": "Thanks to your amazing support, we’ve officially entered the sampling phase for our new bust-friendly designs! We’re currently selecting fabrics and colors, and we’d love to get your input.
\r\n
\r\nWhat types of fabrics do you love? Are you into bold colors, soft pastels, or neutrals? Your feedback will help us create styles that truly resonate with our supporters.
\r\n
\r\nPlease share your thoughts in the comments below—your input means the world to us as we continue this journey together!
\r\n
\r\nThank you again for believing in Exclusively Kristen! ", + "subject": " We’re in the Sampling Phase! ", + "date": "2024-09-13T16:11:15Z", + "image": null + } +]; + +const lender = { + id: 1017469, + public: true, + inviterName: 'Test User', +}; + +const story = (args = {}) => { + const template = (_args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { JournalUpdatesCarousel }, + mixins: [apolloStoryMixin(), cookieStoreStoryMixin()], + setup() { return { args }; }, + provide: { + $kvTrackEvent: () => Promise.resolve({ + fn: () => ({}), + }), + }, + template: ` +
+ +
+ `, + }); + template.args = args; + return template; +}; + +export const Default = story({ loan: mockLoans[0], updates, lender, totalUpdates: 4 }); +export const SingleUpdate = story({ loan: mockLoans[0], updates: [updates[0]], lender, totalUpdates: 1 }); diff --git a/src/components/BorrowerProfile/JournalUpdates.vue b/src/components/BorrowerProfile/JournalUpdates.vue index 5dd7d9678b..a81201fe80 100644 --- a/src/components/BorrowerProfile/JournalUpdates.vue +++ b/src/components/BorrowerProfile/JournalUpdates.vue @@ -54,34 +54,12 @@ diff --git a/src/components/Iwd/ActivityAvatar.vue b/src/components/Iwd/ActivityAvatar.vue index 6e3a432823..04d784ec32 100644 --- a/src/components/Iwd/ActivityAvatar.vue +++ b/src/components/Iwd/ActivityAvatar.vue @@ -1,38 +1,51 @@ + + diff --git a/src/components/MyKiva/JournalUpdatesCarousel.vue b/src/components/MyKiva/JournalUpdatesCarousel.vue new file mode 100644 index 0000000000..2d9b1c3e85 --- /dev/null +++ b/src/components/MyKiva/JournalUpdatesCarousel.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/src/components/MyKiva/MyKivaProfile.vue b/src/components/MyKiva/MyKivaProfile.vue index f04ffc8bac..f09401d121 100644 --- a/src/components/MyKiva/MyKivaProfile.vue +++ b/src/components/MyKiva/MyKivaProfile.vue @@ -1,7 +1,12 @@