|
| 1 | +import React from 'react'; |
| 2 | + |
| 3 | +import { withKnobs } from '@storybook/addon-knobs'; |
| 4 | +import { ServiceContextProvider } from '../../../../../../src/app/contexts/ServiceContext'; |
| 5 | +import { withServicesKnob } from '../../../../../../src/app/legacy/psammead/psammead-storybook-helpers/src'; |
| 6 | +import ThemeProvider from '../../../../../../src/app/components/ThemeProvider'; |
| 7 | +import Header from '.'; |
| 8 | +import { StoryProps } from '../../../../../../src/app/models/types/storybook'; |
| 9 | +import metadata from './metadata.json'; |
| 10 | + |
| 11 | +interface ComponentProps extends StoryProps { |
| 12 | + title: string; |
| 13 | + description?: string; |
| 14 | + showLiveLabel: boolean; |
| 15 | +} |
| 16 | + |
| 17 | +const Component = ({ |
| 18 | + service, |
| 19 | + variant, |
| 20 | + title, |
| 21 | + description, |
| 22 | + showLiveLabel, |
| 23 | +}: ComponentProps) => { |
| 24 | + return ( |
| 25 | + <ThemeProvider service={service} variant={variant}> |
| 26 | + <ServiceContextProvider service={service} variant={variant}> |
| 27 | + <Header |
| 28 | + showLiveLabel={showLiveLabel} |
| 29 | + title={title} |
| 30 | + description={description} |
| 31 | + /> |
| 32 | + </ServiceContextProvider> |
| 33 | + </ThemeProvider> |
| 34 | + ); |
| 35 | +}; |
| 36 | + |
| 37 | +export default { |
| 38 | + title: 'New Components/LivePageHeader', |
| 39 | + Component, |
| 40 | + parameters: { |
| 41 | + metadata, |
| 42 | + design: [ |
| 43 | + { |
| 44 | + name: 'Group 0', |
| 45 | + type: 'figma', |
| 46 | + url: 'https://www.figma.com/file/ozHsWG5R9tETw6lBOU740V/Live-mvp-header---handover?type=design&node-id=95-266', |
| 47 | + }, |
| 48 | + ], |
| 49 | + }, |
| 50 | + decorators: [withKnobs, withServicesKnob()], |
| 51 | +}; |
| 52 | + |
| 53 | +export const TitleOnlyWithLiveLabel = ({ service, variant }: StoryProps) => ( |
| 54 | + <Component |
| 55 | + title="Prince Harry's hacking case against Mirror back in court" |
| 56 | + description="" |
| 57 | + showLiveLabel |
| 58 | + service={service} |
| 59 | + variant={variant} |
| 60 | + /> |
| 61 | +); |
| 62 | +export const TitleAndDescriptionWithLiveLabel = ({ |
| 63 | + service, |
| 64 | + variant, |
| 65 | +}: StoryProps) => ( |
| 66 | + <Component |
| 67 | + title="An kai wa jirgin kwashe yan Turkiyya hari a Sudan" |
| 68 | + description="Wannan shaft ne da ke kawo muku laqbarai daga sassan duniya daban-daban" |
| 69 | + showLiveLabel |
| 70 | + service={service} |
| 71 | + variant={variant} |
| 72 | + /> |
| 73 | +); |
| 74 | +export const RightToLeftWithLiveLabel = ({ service, variant }: StoryProps) => ( |
| 75 | + <Component |
| 76 | + title="نااہلی کی مدت میں ترمیم: ’نواز شریف کی قیادت میں اسی سال ترقی کا سفر دوبارہ شروع ہوگا‘" |
| 77 | + description="سینیٹ نے الیکشن ایکٹ میں ترمیم کا بل کثرت رائے سے منظور کیا ہے جس کے مطابق جہاں آئین میں نااہلی کی مدت کا تعین نہیں وہاں نااہلی پانچ سال سے زیادہ نہیں ہو گی۔ وزیر داخلہ رانا ثنا اللہ کا کہنا ہے کہ نواز شریف کی قیادت میں 'اسی سال ترقی کا سفر دوبارہ شروع ہوگا۔' جبکہ سینیٹ میں اپوزیشن لیڈر شہزاد وسیم نے اسے 'ایک فرد سے متعلق قانون سازی' قرار دیا ہے۔" |
| 78 | + showLiveLabel |
| 79 | + service={service} |
| 80 | + variant={variant} |
| 81 | + /> |
| 82 | +); |
| 83 | + |
| 84 | +export const TitleOnlyWithoutLiveLabel = ({ service, variant }: StoryProps) => ( |
| 85 | + <Component |
| 86 | + title="Prince Harry's hacking case against Mirror back in court" |
| 87 | + description="" |
| 88 | + showLiveLabel={false} |
| 89 | + service={service} |
| 90 | + variant={variant} |
| 91 | + /> |
| 92 | +); |
| 93 | +export const TitleAndDescriptionWithoutLiveLabel = ({ |
| 94 | + service, |
| 95 | + variant, |
| 96 | +}: StoryProps) => ( |
| 97 | + <Component |
| 98 | + title="An kai wa jirgin kwashe yan Turkiyya hari a Sudan" |
| 99 | + description="Wannan shaft ne da ke kawo muku laqbarai daga sassan duniya daban-daban" |
| 100 | + showLiveLabel={false} |
| 101 | + service={service} |
| 102 | + variant={variant} |
| 103 | + /> |
| 104 | +); |
| 105 | +export const RightToLeftWithoutLiveLabel = ({ |
| 106 | + service, |
| 107 | + variant, |
| 108 | +}: StoryProps) => ( |
| 109 | + <Component |
| 110 | + title="نااہلی کی مدت میں ترمیم: ’نواز شریف کی قیادت میں اسی سال ترقی کا سفر دوبارہ شروع ہوگا‘" |
| 111 | + description="سینیٹ نے الیکشن ایکٹ میں ترمیم کا بل کثرت رائے سے منظور کیا ہے جس کے مطابق جہاں آئین میں نااہلی کی مدت کا تعین نہیں وہاں نااہلی پانچ سال سے زیادہ نہیں ہو گی۔ وزیر داخلہ رانا ثنا اللہ کا کہنا ہے کہ نواز شریف کی قیادت میں 'اسی سال ترقی کا سفر دوبارہ شروع ہوگا۔' جبکہ سینیٹ میں اپوزیشن لیڈر شہزاد وسیم نے اسے 'ایک فرد سے متعلق قانون سازی' قرار دیا ہے۔" |
| 112 | + showLiveLabel={false} |
| 113 | + service={service} |
| 114 | + variant={variant} |
| 115 | + /> |
| 116 | +); |
0 commit comments