-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(story):image should be displayed on login page
- Loading branch information
1 parent
8a64944
commit 35869df
Showing
6 changed files
with
174 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/arc-lib/src/lib/components/auth/login/login.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 76 additions & 44 deletions
120
projects/arc-lib/src/stories/components/LoginPage.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,79 @@ | ||
import { moduleMetadata } from '@storybook/angular'; | ||
|
||
import { AuthService } from '@project-lib/core/auth'; | ||
import { LoginComponent } from '@project-lib/components/index'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { ThemeModule } from '@project-lib/theme/theme.module'; | ||
import { NbThemeModule } from '@nebular/theme'; | ||
|
||
|
||
export default { | ||
title: 'Components/Login', | ||
component: LoginComponent, | ||
decorators: [ | ||
moduleMetadata({ | ||
imports:[ThemeModule, | ||
NbThemeModule.forRoot()], | ||
providers: [ | ||
{ | ||
provide: ActivatedRoute, | ||
useValue: { | ||
/* Mock ActivatedRoute data here if needed */ | ||
}, | ||
import {Meta, StoryObj, moduleMetadata} from '@storybook/angular'; | ||
import {AuthService} from '@project-lib/core/auth'; | ||
import {LoginComponent} from '@project-lib/components/index'; | ||
import {ActivatedRoute} from '@angular/router'; | ||
import {ThemeModule} from '@project-lib/theme/theme.module'; | ||
import {NbThemeModule} from '@nebular/theme'; | ||
|
||
const meta = { | ||
title: 'Components/Login', | ||
component: LoginComponent, | ||
decorators: [ | ||
moduleMetadata({ | ||
imports: [ThemeModule, NbThemeModule.forRoot()], | ||
providers: [ | ||
{ | ||
provide: ActivatedRoute, | ||
useValue: { | ||
/* Mock ActivatedRoute data here if needed */ | ||
}, | ||
{ | ||
provide: Location, | ||
useValue: { | ||
/* Mock Location methods here if needed */ | ||
}, | ||
}, | ||
{ | ||
provide: Location, | ||
useValue: { | ||
/* Mock Location methods here if needed */ | ||
}, | ||
{ | ||
provide: AuthService, | ||
useValue: { | ||
/* Mock AuthService methods here if needed */ | ||
}, | ||
}, | ||
{ | ||
provide: AuthService, | ||
useValue: { | ||
/* Mock AuthService methods here if needed */ | ||
}, | ||
], | ||
}), | ||
], | ||
}; | ||
|
||
const Template = (args: LoginComponent) => ({ | ||
component: LoginComponent, | ||
props: args, | ||
}); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
}, | ||
], | ||
}), | ||
], | ||
} as Meta; | ||
export default meta; | ||
|
||
// // const Template: Story<LoginComponent> = (args: LoginComponent) => ({ | ||
// // component: LoginComponent, | ||
// // props: args, | ||
// // // template: `<app-login [image]="${image}"></app-login>`, | ||
// // }); | ||
|
||
// // export const Default = Template.bind({}); | ||
// // Default.args = { | ||
// // image: '../../lib/assets/images/auth/angular.png', | ||
// // //image: '../assets/angular.png', | ||
// // }; | ||
|
||
// const meta: Meta<LoginComponent> = { | ||
// component: LoginComponent, | ||
// }; | ||
|
||
// export default meta; | ||
// type Story = StoryObj<typeof meta>; | ||
|
||
// // Assume image.png is located in the "public" directory. | ||
// export const WithAnImage: Story = { | ||
// render: () => ({ | ||
// props: { | ||
// src: '/images/auth/angular.png', | ||
// alt: 'my image', | ||
// }, | ||
// }), | ||
// }; | ||
|
||
/// from official docs | ||
type Story = StoryObj<typeof meta>; | ||
|
||
//append the path of image relative to the staticdir in main.ts | ||
export const WithAnImage: Story = { | ||
render: () => ({ | ||
props: { | ||
imageUrl: '/images/auth/angular.png', | ||
altText: 'my image', | ||
}, | ||
}), | ||
}; |