Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

2.3 KB
Raw Blame
<div class="container">
  <h1 class="d-none d-sm-block h3 mb-4 text-center" i18n>Markets</h1>
  @if (
    hasPermissionToAccessFearAndGreedIndex ||
    hasPermissionToReadMarketDataOfMarkets
  ) {
    <div class="mb-4 row">
      <div class="col-md-10 offset-md-1">
        @if (hasPermissionToReadMarketDataOfMarkets) {
          @if (user?.settings?.isExperimentalFeatures) {
            <div
              class="align-items-center d-flex flex-grow-1 justify-content-end"
            >
              <gf-toggle
                class="d-none d-lg-block"
                [defaultValue]="fearAndGreedIndexMode"
                [isLoading]="false"
                [options]="fearAndGreedIndexModeOptions"
                (valueChange)="onChangeFearAndGreedIndexMode($event.value)"
              />
            </div>
          }
          <div class="mb-2 text-body-secondary text-center">
            <small i18n>Last {{ numberOfDays }} Days</small>
          </div>
          <gf-line-chart
            class="mb-3"
            label="Fear & Greed Index"
            [colorScheme]="user?.settings?.colorScheme"
            [historicalDataItems]="historicalDataItems"
            [isAnimated]="true"
            [locale]="user?.settings?.locale ?? DEFAULT_LOCALE"
            [showXAxis]="true"
            [showYAxis]="true"
            [yMax]="100"
            [yMaxLabel]="greedLabel"
            [yMin]="0"
            [yMinLabel]="fearLabel"
          />
        }
        <gf-fear-and-greed-index
          class="d-flex justify-content-center"
          [fearAndGreedIndex]="fearAndGreedIndex"
          [isLoading]="isLoadingFearAndGreedIndex"
        />
      </div>
    </div>
  }

  <div class="mb-3 row">
    <div class="col-md-10 offset-md-1">
      <gf-benchmark
        [benchmarks]="benchmarks()"
        [deviceType]="deviceType()"
        [hasPermissionToOpenDetails]="hasPermissionToOpenBenchmarkDetails"
        [locale]="user?.settings?.locale ?? DEFAULT_LOCALE"
        [showSymbol]="false"
        [user]="user"
      />
      @if (benchmarks()?.length) {
        <div
          class="gf-text-wrap-balance lh-1 mt-3 text-body-secondary text-center"
        >
          <small i18n>
            Calculations are based on delayed market data and may not be
            displayed in real-time.</small
          >
        </div>
      }
    </div>
  </div>
</div>