Skip to content

Commit

Permalink
update error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Millet authored and Jean-Marc Millet committed Oct 20, 2023
1 parent 41a6afc commit 6a07d58
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 184 deletions.
48 changes: 13 additions & 35 deletions stories/errorpage401.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,19 @@ import { Wrapper } from './common';
export default {
title: 'Components/Navigation/ErrorPages/401',
component: ErrorPage401,
decorators:[(story) => (
<Wrapper style={{height:"100vh"}}>
{story()}
</Wrapper>) ],
args:{
supportLink:"https://www.scality.com/support/",
onReturnHomeClick:() => {}
}
};
export const Default = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage401
supportLink="https://www.scality.com/support/"
onReturnHomeClick={() => {}}
/>
</div>
</Wrapper>
);
},
};
export const Default = {};

export const WithLocale = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage401
locale="fr"
supportLink="https://www.scality.com/support/"
onReturnHomeClick={() => {}}
/>
</div>
</Wrapper>
);
},
args:{
locale:"fr"
}
};
42 changes: 13 additions & 29 deletions stories/errorpage404.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,18 @@ import { Wrapper } from './common';
export default {
title: 'Components/Navigation/ErrorPages/404',
component: ErrorPage404,
decorators:[(story) => (
<Wrapper style={{height:"100vh"}}>
{story()}
</Wrapper>) ],
args:{
onReturnHomeClick:() => {}
}
};
export const Default = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage404 onReturnHomeClick={() => {}} />
</div>
</Wrapper>
);
},
};
export const Default = {}

export const WithLocale = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage404 locale="fr" onReturnHomeClick={() => {}} />
</div>
</Wrapper>
);
},
};
args:{
locale:"fr"
}
}
107 changes: 36 additions & 71 deletions stories/errorpage500.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,44 @@ import { Wrapper } from './common';
export default {
title: 'Components/Navigation/ErrorPages/500',
component: ErrorPage500,
};
export const Default = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage500 onReturnHomeClick={() => {}} />
</div>
</Wrapper>
);
decorators:[(story) => (
<Wrapper style={{height:"100vh"}}>
{story()}
</Wrapper>) ],
args:{
onReturnHomeClick:() => {}
},
argTypes:{
locale:{
options:["en","fr"],
control:{ type:'radio'}
},
errorMessage:{
control:{
type:'object'
}
}
}
};
export const Default = {}

export const WithSupportLink = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage500
supportLink="https://www.scality.com/support/"
onReturnHomeClick={() => {}}
/>
</div>
</Wrapper>
);
},
};
args:{
supportLink:"https://www.scality.com/support/",
}
}
export const WithLocale = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage500
supportLink="https://www.scality.com/support/"
locale="fr"
onReturnHomeClick={() => {}}
/>
</div>
</Wrapper>
);
},
};
args:{
supportLink:"https://www.scality.com/support/",
locale:"fr"
}
}
export const CustomerizedError = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPage500
supportLink="https://www.scality.com/support/"
locale="en"
onReturnHomeClick={() => {}}
errorMessage={{
en: 'Failed to log you in, this might be due to time synchronization between the browser and the server.',
fr: `Impossible de vous connecter, cela peut être dû à la synchronisation de l'heure entre le navigateur et le serveur.`,
}}
/>
</div>
</Wrapper>
);
},
};
args:{
supportLink:"https://www.scality.com/support/",
errorMessage:{
en: 'Failed to log you in, this might be due to time synchronization between the browser and the server.',
fr: `Impossible de vous connecter, cela peut être dû à la synchronisation de l'heure entre le navigateur et le serveur.`,
}
}
}
73 changes: 24 additions & 49 deletions stories/errorpageauth.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,31 @@ import { Wrapper } from './common';
export default {
title: 'Components/Navigation/ErrorPages/Auth',
component: ErrorPageAuth,
};
export const Default = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPageAuth onReturnHomeClick={() => {}} />
</div>
</Wrapper>
);
decorators:[(story) => (
<Wrapper style={{height:"100vh"}}>
{story()}
</Wrapper>) ],
args:{
onReturnHomeClick:() => {}
},
argTypes:{
locale:{
options:["en","fr"],
control:{ type:'radio'}
},
}
};
export const Default = {}

export const WithSupportLink = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPageAuth
supportLink="https://www.scality.com/support/"
onReturnHomeClick={() => {}}
/>
</div>
</Wrapper>
);
},
};
args:{
supportLink:"https://www.scality.com/support/"
}
}

export const WithLocale = {
render: ({}) => {
return (
<Wrapper>
<div
style={{
height: '100vh',
}}
>
<ErrorPageAuth
btnLink="/"
supportLink="https://www.scality.com/support/"
locale="fr"
/>
</div>
</Wrapper>
);
},
};
args:{
locale:'fr',
supportLink:"https://www.scality.com/support/"
}
}

0 comments on commit 6a07d58

Please sign in to comment.