-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(payments): update PaymentErrorView component to utilize Tail…
…wind Because: * We want to convert to Tailwind across fxa for consistency and to improve overall maintenance * We want to improve responsiveness and UI/UX * We want to improve accessibility This commit: * Replaces all CSS/SCSS with Tailwind utility classes * Removes .css and .scss files * Reworks Storybook files Closes #13583
- Loading branch information
Meghan Sardesai
committed
Jul 30, 2022
1 parent
a3624ab
commit 6160087
Showing
4 changed files
with
38 additions
and
56 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
46 changes: 29 additions & 17 deletions
46
packages/fxa-payments-server/src/components/PaymentErrorView/index.stories.tsx
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,22 +1,34 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { PaymentErrorView } from './index'; | ||
import { SELECTED_PLAN } from '../../lib/mock-data'; | ||
import { BrowserRouter, Routes, Route } from 'react-router-dom'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
storiesOf('components/PaymentError', module).add('default', () => ( | ||
<BrowserRouter> | ||
<Routes> | ||
<Route | ||
path="*" | ||
element={ | ||
<PaymentErrorView | ||
error={{ code: 'general-paypal-error' }} | ||
actionFn={() => {}} | ||
plan={SELECTED_PLAN} | ||
/> | ||
} | ||
/> | ||
</Routes> | ||
</BrowserRouter> | ||
)); | ||
export default { | ||
title: 'components/PaymentError', | ||
component: PaymentErrorView, | ||
} as Meta; | ||
|
||
const storyWithContext = (storyName?: string) => { | ||
const story = () => ( | ||
<BrowserRouter> | ||
<Routes> | ||
<Route | ||
path="*" | ||
element={ | ||
<PaymentErrorView | ||
error={{ code: 'general-paypal-error' }} | ||
actionFn={() => {}} | ||
plan={SELECTED_PLAN} | ||
/> | ||
} | ||
/> | ||
</Routes> | ||
</BrowserRouter> | ||
); | ||
|
||
if (storyName) story.storyName = storyName; | ||
return story; | ||
}; | ||
|
||
export const Default = storyWithContext('default'); |
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