mirror of
https://github.com/overleaf/overleaf.git
synced 2025-12-05 01:10:29 +00:00
* Update test for the loading spinner component * Create a story for the loading spinner component * Move role and use CSS for spacing instead * Add a classname prop * Reuse LoadingSpinner * Use OLSpinner instead of Spinner * Use data-testid since status role was moved * Wait for journals to load * Use `isLoading` prop instead and fix the button's height * Use `isLoading` prop instead * Use LoadingSpinner instead and remove spacing * Update test for the loading spinner component * Use `isLoading` prop instead * Add aria-describedby to layout button for processing state * Replace `spinner` to `ol-spinner` * Scope status * Remove redundant `div.loading` --------- Co-authored-by: Antoine Clausse <antoine.clausse@overleaf.com> GitOrigin-RevId: 8f43b991f8f458b2abd5a4661913ac9b972d892a
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react'
|
|
import LoadingSpinner, {
|
|
FullSizeLoadingSpinner,
|
|
} from '@/shared/components/loading-spinner'
|
|
|
|
type Story = StoryObj<typeof LoadingSpinner>
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
loadingText: 'Loading content...',
|
|
},
|
|
}
|
|
|
|
export const WithDelay: Story = {
|
|
args: {
|
|
delay: 500,
|
|
loadingText: 'This will appear after a 500ms delay...',
|
|
},
|
|
}
|
|
|
|
export const FullSize: StoryObj<typeof FullSizeLoadingSpinner> = {
|
|
render: args => <FullSizeLoadingSpinner {...args} />,
|
|
args: {
|
|
loadingText: 'Loading entire section...',
|
|
size: 'sm',
|
|
},
|
|
}
|
|
|
|
const meta: Meta<typeof LoadingSpinner> = {
|
|
title: 'Shared / Components / Loading Spinner',
|
|
component: LoadingSpinner,
|
|
parameters: {
|
|
layout: 'centered',
|
|
},
|
|
argTypes: {
|
|
delay: {
|
|
control: 'select',
|
|
options: [0, 500],
|
|
},
|
|
size: {
|
|
control: 'radio',
|
|
options: ['lg', 'sm'],
|
|
},
|
|
},
|
|
args: {
|
|
size: 'sm',
|
|
delay: 0,
|
|
},
|
|
render: args => <LoadingSpinner {...args} />,
|
|
}
|
|
|
|
export default meta
|