1.0.4 • Published 1 year ago

@glisser/react v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

import { Meta } from "@storybook/addon-docs";

Glisser Elements - React Component Library

Glisser Elements is a virtual events SDK, based on Glisser's award-winning tech platform, that allows enterprises and their agencies to create bespoke virtual and hybrid events experiences using Glisser's highly-developed components, inside their own websites. Learn more about Glisser here and about Glisser Elements here.

Note: you need a Glisser account to use the Elements. Sign up for free here.

Navigate

How To Use Glisser Elements

Step 1: Scaffolding Your Project

If you need help setting up a React application, we have a guide available.

Step 2: Installation

Run the following command to install the Glisser React package:

npm install @glisser/react

// or

yarn add @glisser/react

Step 3: Setting-up Glisser Elements

To use Glisser Elements in your app, you first need to ensure you import the GlsrProvider component and useSession hook.

GlsrProvider is a wrapper for all Glisser Elements and is an instantiation of the React Context API.

useSession is a custom hook used by Glisser Elements as the central source of truth for all session related state.

import { GlsrProvider, useSession } from '@glisser/react'

const App = () => {
  const [session, setSession] = useSession({ code: '' })

  return (
    <GlsrProvider session={session} setSession={setSession}>
      // glisser elements
    </GlsrProvider>
  )
}

export default App

Step 4: Adding Glisser Elements

Once you have the above set-up, you're ready to start importing and utilising Glisser Elements into your app:

ComponentPropsTypeDefaultDescription
SlideFeedareamain | tabsmainTBC
boardingbooleanfalseSetting the value to true will cause this component to render the on-boarding form
debugbooleanfalseTBC
streamComponentReact.ReactNodePass in an instance of the <Stream /> component to allow toggling between slide and stream view
SlideTab**
AttendeeListboardingbooleanfalseSetting the value to true will cause this component to render the on-boarding form
Optional debugbooleanTBC
CommentFeedboardingbooleanfalseSetting the value to true will cause this component to render the on-boarding form
Optional debugbooleanTBC
Download**Optional displayHeaderboolean
NoteFeed**Optional displayHeaderboolean
Related**Optional displayHeaderboolean
Optional inlineboolean
showMenubooleanfalse
Social**TBC
Stream**Optional streamTBC
Optional providerTBC
Subtitles**

**SlideTab, Download, NoteFeed, Related, Social, Stream and Subtitles cannot be used on their own as they require either SlideFeed, AttendeeList and/or CommentFeed for the boarding process.

An object containing a key of code with a property of type string is also required (an empty string is OK) by the useSession hook:

const [session, setSession] = useSession()

return (
  <GlsrProvider>
    <SlideTab />
    <Download />
  </GlsrProvider>
)
const [session, setSession] = useSession({ code: '' })

return (
  <GlsrProvider session={session} setSession={setSession}>
    <SlideFeed boarding={true} />
    <NoteFeed />
    <Download />
  </GlsrProvider>
)

Boarding property

Note that <SlideFeed /> has a boarding prop set to true which will load the event boarding process inside this particular component. This prop can be alternatively used with <CommentFeed />.

Silent login

When adding a Glisser element, it is possible to onboard the attendee silently. This creates a seamless experience for the attendee in which they will not be prompted for a Glisser code or for their identifier (email/uniqueID etc.). In order to do this, arguments can be passed as an object for useSession() which are code, identifier, and profile. Here's an example:

const [session, setSession] = useSession({
  code: 'event-code',
  identifier: 'email@email.com',
  profile: {
    firstName: 'User first name',
    lastName: 'User last name',
    company: 'Company name',
    linkedinUrl: 'https://linkedin.com/',
    location: 'City, State, Country',
  },
})

Note that profile is only needed if intending to use Glisser's Named Q&A and Attendee List features.

Specifications

The Elements are quite flexible in size but it's recommended to keep it not smaller than 350px both width and height.

Quick Start

Below is a basic Glisser session layout to easily copy and paste into your app to test:

import './App.css'
import {
  useSession,
  GlsrProvider,
  SlideFeed,
  SlideTab,
  Download,
} from '@glisser/react-dev'

function App() {
  const [session, setSession] = useSession({ code: 'my-code' })

  const styles = {
    main: {
      display: 'grid',
      gridTemplateColumns: '1fr auto',
      gridTemplateRows: '1fr auto',
      gap: '1rem',
      backgroundColor: '#111',
      padding: '2rem',
    },
    slide: { width: '800px' },
    slideTab: { width: '100%', height: '100%', gridRow: '1 / 3' },
    download: { justifySelf: 'flex-start' },
  }

  return (
    <main style={styles.main}>
      <GlsrProvider session={session} setSession={setSession}>
        <div style={styles.slide}>
          <SlideFeed boarding={true} />
        </div>
        <div style={styles.slideTab}>
          <SlideTab />
        </div>
        <div style={styles.download}>
          <Download />
        </div>
      </GlsrProvider>
    </main>
  )
}

export default App

Customising Elements

A large number of HTML class attributes are exposed throughout Glisser Elements (with more being added as the project evolves). The current list contains the following classes:

Component / ElementComponent NameClass Name (glsr_)FileNotes
Atom/Molecule/OrganismBoardingContainerboarding-containerboarding-container.jsx
BoardingInfoContainerboarding-container__info-containerboarding-info.jsx
BoardingFormContainerboarding-container__form-containerboarding-form.jsx
TextInputElementtext-inputtext-input.jsx
TextInputContainertext-input__containertext-input.jsx
IconHoldertext-input__icon-containertext-input.jsx
LinkLargeIcontext-input__icontext-input.jsx
ButtonBaseContainerbtnbutton-base.jsx
ButtonBaseContainerbtn--primarybutton-base.jsx
ButtonBaseContainerbtn--{ type }button-base.jsx
SlideTabContainerslide-tab__containerslide-tab.jsx
ContentGridContainerslide-tab__gridslide-tab.jsx
SlideThumbContainerslide-tab__thumbslide-tab.jsx
RelatedBodyrelatedrelated.jsx
RelatedHeaderrelated__headerrelated-body.jsx
RelatedTogglerelated__togglerelated-body.jsx
InfoAlertrelated__info-alertrelated-body.jsx
RelatedLinkListrelated__link-listrelated-links.jsx
RelatedLinkrelated__linkrelated-links.jsx
ElementContainernotesnote-feed.jsx
NotesContainernotes__containernote-feed.jsxge-slide-feed-wrapper class still exists
Headernotes__headernote-feed.jsx
NoteThumbsContainernotes__thumb-carouselnote-thumbs.jsx
SlidesListnotes__thumb-listnote-thumbs.jsx
SlidesListItemnotes__thumb-list-itemnote-thumbs.jsx
SlideThumbnotes__thumbnote-thumbs.jsx
slide-feedElementContainerslide-feed__wrapperslide-feed.jsx
SlideViewContainerslide-feed__view-containerslide-feed.jsx
SlideContainerslide-feed__slide-containerslide-feed.jsxge-slide-feed class still exists
SlideViewInnerslide-feed__viewslide-feed.jsx
SlideViewInnerslide-feed__view--topslide-feed.jsxSlides component
SlideViewInnerslide-feed__view--bottomslide-feed.jsxStream component
attendee-listElementContainerattendee-listattendee-list.jsx
SearchInputattendee-list__searchattendee-list.jsx
AttendeeNavContainerattendee-list__navattendee-list.jsx
AttendeeNavContainerattendee-list__nav--no-attendeesattendee-list.jsx
AttendeeCountattendee-list__nav-attendee-countattendee-list.jsx
AttendeePagingattendee-list__nav-attendee-pagingattendee-list.jsx
Listattendee-list__listattendee-list.jsx
Userattendee-list__userattendee-list.jsx
NoAttendeesContainerattendee-list__no-attendeesattendee-list.jsx
Attendeesattendee-list__attendeesattendee-list.jsx
comment-feedElementContainercomment-feedcomment-feed.jsx
CommentsContainercomment-feed__containercomment-feed.jsx
Listcomment-list__attendee-listcomment-list.jsx
CommentNavcomment-list__comment-navcomment-list.jsx
TextTabsAreacomment-list__text-areacomment-list.jsx
ToggleSwitchcomment-list__text-area-togglecomment-list.jsx

Migrating From An Earlier Version

If you have been using elements, prior to the release of 1.0.2, and wish to upgrade versions to the most current you will need to ensure you include the addition of the GlsrProvider into your application.

As outlined above elements now require this context provider to share logic between themselves.

If you have an app which currently looks something like:

function App() {
  const [session, setSession] = useSession()

  return (
    <main>
      <SlideFeed boarding={true} session={session} setSession={setSession} />
      <SlideTab session={session} setSession={setSession} />
      <Download session={session} setSession={setSession} />
    </main>
  )
}

it will now need to look something more like this:

function App() {
  const [session, setSession] = useSession({ code: 'my-code' })

  return (
    <main>
      <GlsrProvider session={session} setSession={setSession}>
        <SlideFeed boarding={true} />
        <SlideTab />
        <Download />
      </GlsrProvider>
    </main>
  )
}

Just make sure than all Glisser Elements any any logic interacting with either the session or setSession values is wrapped within a single instance of this provider.

Support

If you have any technical questions, please go to our forum.

1.0.2

1 year ago

0.0.47

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.36

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.31

3 years ago

0.0.32

2 years ago

0.0.30

3 years ago

0.0.21

3 years ago

0.0.19

3 years ago

0.0.14

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.1

3 years ago

0.0.2

3 years ago

0.0.7

3 years ago