How to use @bbp/react-nexus - 3 common examples

To help you get started, we’ve selected a few @bbp/react-nexus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BlueBrain / nexus-js / apps / search-poc / src / containers / Header.tsx View on Github external
}> = ({ userManager, user }) => {
  const nexus = useNexusContext();

  // fetch list of available realms when application mounts
  const [realms, setRealms] = React.useState([]);
  React.useEffect(() => {
    nexus.Realm.list()
      .then(realms => {
        // nexus uses a realm called `serviceaccount` internally, we need to filter it out
        setRealms(
          realms._results.filter(
            realm => realm._label !== SETTINGS.serviceAccountName,
          ),
        );
      })
      .catch(e => console.error(e));
  }, [nexus]);
github BlueBrain / nexus-js / apps / search-poc / src / hooks / useMorphology.ts View on Github external
export default (
  {
    org,
    proj,
    id,
  }: {
    org: string;
    proj: string;
    id: string;
  },
  viewEl: React.RefObject,
) => {
  const nexus = useNexusContext();

  const [morphology, setMorphology] = React.useState(null);
  const [loading, setLoading] = React.useState(true);
  const [error, setError] = React.useState(null);
  const [stage, setStage] = React.useState();

  // Download and Parse morphology
  React.useEffect(() => {
    setLoading(true);
    setStage('Loading');
    nexus.File.get(org, proj, encodeURIComponent(id), { as: 'blob' })
      .then((morpho: any) => {
        setStage('Converting');
        return morpho;
      })
      .then(convertToSwc)
github BlueBrain / nexus-js / apps / search-poc / src / containers / FileDownLoad.tsx View on Github external
}> = props => {
  const [downloadUrl, setDownloadUrl] = React.useState(null);
  const [isLoading, setLoading] = React.useState(0);
  const [isError, setError] = React.useState(false);
  const nexus = useNexusContext();
  const icons = ['download', 'loading', 'check'];
  const refContainer = React.useRef(null);
  const linkStyle: any = {
    display: 'none',
  };
  const filePanel = () => {
    if (props.isDownload && props.fileIds.length > 0) {
      const fileName = props.downloadFileName
        ? `${props.downloadFileName}.tar.gz`
        : 'nexus-download.tar.gz';
      return (
        <div>
          </div>

@bbp/react-nexus

A set of React components for Nexus

Apache-2.0
Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis

Popular @bbp/react-nexus functions