mirror of https://github.com/ghostfolio/ghostfolio
12 changed files with 93 additions and 47 deletions
@ -1,24 +0,0 @@ |
|||
<div class="position-relative"> |
|||
<div class="align-items-center d-flex flex-row" [hidden]="!fearAndGreedIndex"> |
|||
<div class="h2 mb-0 mr-2">{{ fearAndGreedIndexEmoji }}</div> |
|||
<div> |
|||
<div class="h4 mb-0"> |
|||
<span class="mr-2">{{ fearAndGreedIndexText }}</span> |
|||
<small class="text-muted" |
|||
><strong>{{ fearAndGreedIndex | number: '1.0-0' }}</strong |
|||
>/100</small |
|||
> |
|||
</div> |
|||
<small class="d-block" i18n>Current Market Mood</small> |
|||
</div> |
|||
</div> |
|||
@if (!fearAndGreedIndex) { |
|||
<ngx-skeleton-loader |
|||
animation="pulse" |
|||
class="position-absolute w-100" |
|||
[theme]="{ |
|||
height: '100%' |
|||
}" |
|||
/> |
|||
} |
|||
</div> |
|||
@ -1,8 +0,0 @@ |
|||
:host { |
|||
display: block; |
|||
|
|||
ngx-skeleton-loader { |
|||
bottom: 0; |
|||
top: 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
@if (isLoading() && !fearAndGreedIndex()) { |
|||
<ngx-skeleton-loader |
|||
animation="pulse" |
|||
class="w-100" |
|||
[theme]="{ |
|||
height: '2.5rem' |
|||
}" |
|||
/> |
|||
} @else { |
|||
<div class="align-items-center d-flex flex-row"> |
|||
<div class="h2 mb-0 mr-2">{{ fearAndGreedIndexEmoji() }}</div> |
|||
<div> |
|||
<div class="h4 mb-0"> |
|||
<span class="mr-2">{{ fearAndGreedIndexText() }}</span> |
|||
<small class="text-muted" |
|||
><strong>{{ |
|||
(fearAndGreedIndex() | number: '1.0-0') ?? placeholder |
|||
}}</strong |
|||
>/100</small |
|||
> |
|||
</div> |
|||
<small class="d-block" i18n>Current Market Mood</small> |
|||
</div> |
|||
</div> |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
:host { |
|||
display: block; |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
import '@angular/localize/init'; |
|||
import { moduleMetadata } from '@storybook/angular'; |
|||
import type { Meta, StoryObj } from '@storybook/angular'; |
|||
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|||
|
|||
import { GfFearAndGreedIndexComponent } from './fear-and-greed-index.component'; |
|||
|
|||
export default { |
|||
title: 'Fear & Greed Index', |
|||
component: GfFearAndGreedIndexComponent, |
|||
decorators: [ |
|||
moduleMetadata({ |
|||
imports: [NgxSkeletonLoaderModule] |
|||
}) |
|||
] |
|||
} as Meta<GfFearAndGreedIndexComponent>; |
|||
|
|||
type Story = StoryObj<GfFearAndGreedIndexComponent>; |
|||
|
|||
export const Loading: Story = { |
|||
args: { |
|||
fearAndGreedIndex: undefined, |
|||
isLoading: true |
|||
} |
|||
}; |
|||
|
|||
export const Default: Story = { |
|||
args: { |
|||
fearAndGreedIndex: 50, |
|||
isLoading: false |
|||
} |
|||
}; |
|||
|
|||
export const Unknown: Story = { |
|||
args: { |
|||
fearAndGreedIndex: undefined, |
|||
isLoading: false |
|||
} |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
export * from './fear-and-greed-index.component'; |
|||
Loading…
Reference in new issue