0.2.33 • Published 2 years ago

@gandalfeng/connect v0.2.33

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Connect

Connect is a drop-in modal that will speak to Watson & enable us to easily guide a user through the Spotify sign in process.

Initialization

import type { AppProps } from 'next/app';
import { GandalfConnectProvider } from '../context';

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <GandalfConnectProvider>
        <Component {...pageProps} />
      </GandalfConnectProvider>
    </>
  );
}

Usage

import { useGandalfConnect } from '../context';

const Connect = () => {
  const { state, setGandalfConnectConfig, toggleModal } = useGandalfConnect();

  useEffect(() => {
    setGandalfConnectConfig({ publicKey: 'pk_test_123', platform: 'spotify' });
  }, [setGandalfConnectConfig]);

  return (
    <>
      <button onClick={() => toggleModal()}>
        another thing: {state.response}
      </button>
    </>
  );
};
0.2.33

2 years ago

0.2.32

2 years ago

0.2.31

2 years ago

0.2.30

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago