UCLALibrary / ucla-library-website-components

This is a library of Vue components that will be used in UCLA Library Nuxt websites.
Other
6 stars 1 forks source link

Component Request - FTVA DropdownButton #554

Open tinuola opened 1 month ago

tinuola commented 1 month ago

Component Description

This component is a button with a dropdown modal, and will be used to create the Share button and the Add to Calendar button.

Share-Dropdown

Calendar-Dropdown

Design

add-to-calendar-mobile

Slots

No Slots

Props

Event data pending from UX

props: {
    eventDetail: { 
        type: Object,
        default: () => {}
    },
    socialList: {
        type: Array, // social objects?
        default: () => [] 
    },
    title: { // Button Text
        type: String,
        default: () => ""
    },
    hasIcon: { // Not the dropdown toggle icon
        type: Boolean,
        default: () => ""
    },
   ...
}

Developer Tips

  1. See annotations for styling details:

  2. Share APIs for social media links:

  3. Use useRoute to retrieve event detail page url for social media sharing

  4. Use Add to Calendar Button plugin for calendar configuration: https://add-to-calendar-button.com/

  5. Pass properties from the eventDetail object (or whatever that prop will be called...) to the add-to-calendar component ; See plugin configuration page for potential attributes that can be used / correlate with data we want to provide

    <add-to-calendar-button
      name="Title"
      options="'Apple','Google'"
      location="World Wide Web"
      startDate="2023-02-03"
      endDate="2023-02-03"
      startTime="10:15"
      endTime="23:30"
      timeZone="America/Los_Angeles"
      debug
    ></add-to-calendar-button>

Events

  1. When button is clicked, a dropdown box/modal appears
  2. Social media and calendar links open to respective platform (login/auth) pages
  3. .ics link in calendar dropdown downloads an .ics file

Child components

farosFreed commented 1 month ago

not sure if I'm the one implementing this, but looks good to me ✅ Appreciate all the legwork you did on the calendar implementation questions.