HelpLanding.tsx 5.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
/**
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import React, { useState } from 'react';

import LabelledAppIcon from '../labelled-app-icon/LabelledAppIcon';
import { Step } from 'src/shared/components/step/Step';
import ShowHide from 'src/shared/components/show-hide/ShowHide';

import { isEnvironment, Environment } from 'src/shared/helpers/environment';

import { ReactComponent as SearchIcon } from 'static/img/sidebar/search.svg';

import styles from './HelpLanding.scss';

const HelpLanding = () => {
  return (
    <div className={styles.helpLanding}>
      <AppsSection />
      <StartUsingSection />
      {
        /* We don't yet have full documentation announced in this section */
        isEnvironment([Environment.DEVELOPMENT, Environment.INTERNAL]) && (
          <LastSection />
        )
      }
    </div>
  );
};

const AppsSection = () => {
  return (
    <section>
      <h1>Ensembl apps</h1>

      <div className={styles.appsGrid}>
        <div className={styles.appBlock}>
          <div className={styles.appLabel}>
            <LabelledAppIcon app="speciesSelector" />
          </div>
          Create &amp; manage your own species list
          <ul>
            <li>opened from the launchbar at the top of every page</li>
            <li>add as many species as you want</li>
            <li>your species will then be available across all apps</li>
            <li>use the species tabs to see information about each species</li>
          </ul>
        </div>

        <div className={styles.appBlock}>
          <div className={styles.appLabel}>
            <LabelledAppIcon app="genomeBrowser" />
          </div>
          Look at genes &amp; transcripts in their genetic context
          <ul>
            <li>opened from the launchbar at the top of every page</li>
            <li>
              view an example gene or region, or search for your own genes
            </li>
            <li>download the data you want</li>
          </ul>
        </div>

        <div className={styles.appBlock}>
          <div className={styles.appLabel}>
            <LabelledAppIcon app="entityViewer" />
          </div>
          Get gene &amp; transcript information
          <ul>
            <li>opened from the launchbar at the top of every page</li>
            <li>see all the information we have for your gene</li>
            <li>download the data you want</li>
          </ul>
        </div>
      </div>
    </section>
  );
};

const StartUsingSection = () => {
  const [isExpanded, setIsExpanded] = useState(false);

  const toggleExpanded = () => setIsExpanded(!isExpanded);

  return (
    <section>
      <h1>Start using the apps</h1>
      <div>
        <span>A step-by-step guide to using an app for the first time</span>
        <ShowHide
          label="Show me what to do"
          isExpanded={isExpanded}
          onClick={toggleExpanded}
          classNames={{ wrapper: styles.showHideWrapper }}
        />
      </div>

      {isExpanded && (
        <div className={styles.stepsGrid}>
          <div>
            <Step count={1} label="Find and add a species">
              <LabelledAppIcon app="speciesSelector" size="small" />
            </Step>
          </div>

          <div>
            <Step count={2} label="Select an app">
              <div className={styles.stepChildren}>
                <LabelledAppIcon app="genomeBrowser" size="small" />
                <LabelledAppIcon app="entityViewer" size="small" />
              </div>
            </Step>
          </div>

          <div>
            <Step
              count={3}
              label="Use Search or the example links to view a gene or region"
            >
              <div className={styles.stepChildren}>
                <SearchIcon className={styles.searchIcon} />
                <div>Example gene</div>
                <div>Example region</div>
              </div>
            </Step>
          </div>
        </div>
      )}
    </section>
  );
};

const LastSection = () => {
  return (
    <section className={styles.lastSectionGrid}>
      <div>
        <h1>Using Ensembl</h1>
        <p>
          Use the Help menu above to find articles &amp; videos that will help
          you understand more about what what each app does, and how to use it
        </p>
      </div>
      <div>
        <h1>Ensembl annotation &amp; prediction</h1>
        <p>
          Learn how Ensembl predicts the genes present in an assembled genome,
          and is then able to provide efficient functional annotations to those
          genes.
        </p>
      </div>
    </section>
  );
};

export default HelpLanding;