-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70d0d76
commit 5201bed
Showing
13 changed files
with
122 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@adyen/adyen-web': minor | ||
--- | ||
|
||
PayMe - Improved instructions UI |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
23 changes: 23 additions & 0 deletions
23
packages/lib/src/components/PayMe/components/PayMeInstructions.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useIsMobile } from '../../../utils/useIsMobile'; | ||
import { useCoreContext } from '../../../core/Context/CoreProvider'; | ||
import { Timeline, TimelineWrapper } from '../../internal/Timeline'; | ||
import { h } from 'preact'; | ||
|
||
const PayMeInstructions = () => { | ||
const { i18n } = useCoreContext(); | ||
const { isMobileScreenSize } = useIsMobile(); | ||
|
||
if (isMobileScreenSize) { | ||
return null; | ||
} | ||
|
||
const instructions = i18n.get('payme.instructions.steps').split('%@'); | ||
|
||
return ( | ||
<TimelineWrapper> | ||
<Timeline instructions={instructions} /> | ||
</TimelineWrapper> | ||
); | ||
}; | ||
|
||
export { PayMeInstructions }; |
21 changes: 21 additions & 0 deletions
21
packages/lib/src/components/PayMe/components/PayMeIntroduction.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useCoreContext } from '../../../core/Context/CoreProvider'; | ||
import { useIsMobile } from '../../../utils/useIsMobile'; | ||
import { Timeline, TimelineWrapper } from '../../internal/Timeline'; | ||
import { Fragment, h } from 'preact'; | ||
|
||
const PayMeIntroduction = () => { | ||
const { i18n } = useCoreContext(); | ||
const { isMobileScreenSize } = useIsMobile(); | ||
|
||
const instructions = i18n.get('payme.instructions.steps').split('%@'); | ||
|
||
return isMobileScreenSize ? ( | ||
<TimelineWrapper> | ||
<Timeline instructions={instructions} /> | ||
</TimelineWrapper> | ||
) : ( | ||
<Fragment>{i18n.get('payme.scanQrCode')}</Fragment> | ||
); | ||
}; | ||
|
||
export { PayMeIntroduction }; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.adyen-checkout__qr-loader--swish > .adyen-checkout__qr-loader__instructions { | ||
text-align: center; | ||
} |
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
11 changes: 8 additions & 3 deletions
11
packages/lib/src/components/internal/Timeline/TimelineWrapper.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,8 +1,13 @@ | ||
import { h } from 'preact'; | ||
import { ComponentChildren, h } from 'preact'; | ||
import './TimelineWrapper.scss'; | ||
|
||
const TimelineWrapper = ({ children }) => { | ||
return <div className="adyen-checkout-timeline-wrapper">{children}</div>; | ||
interface TimelineWrapperProps { | ||
children: ComponentChildren; | ||
className?: string; | ||
} | ||
|
||
const TimelineWrapper = ({ children, className }: TimelineWrapperProps) => { | ||
return <div className={`adyen-checkout-timeline-wrapper ${className}`}>{children}</div>; | ||
}; | ||
|
||
export { TimelineWrapper }; |
26 changes: 26 additions & 0 deletions
26
packages/lib/storybook/stories/components/Payconic.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { MetaConfiguration, PaymentMethodStoryProps, StoryConfiguration } from '../types'; | ||
import { QRLoaderConfiguration } from '../../../src/types'; | ||
import { ComponentContainer } from '../ComponentContainer'; | ||
import { Checkout } from '../Checkout'; | ||
import BcmcMobile from '../../../src/components/BcmcMobile'; | ||
|
||
type PayconicStory = StoryConfiguration<QRLoaderConfiguration>; | ||
|
||
const meta: MetaConfiguration<QRLoaderConfiguration> = { | ||
title: 'Components/Payconic' | ||
}; | ||
|
||
const render = ({ componentConfiguration, ...checkoutConfig }: PaymentMethodStoryProps<QRLoaderConfiguration>) => ( | ||
<Checkout checkoutConfig={checkoutConfig}> | ||
{checkout => <ComponentContainer element={new BcmcMobile(checkout, componentConfiguration)} />} | ||
</Checkout> | ||
); | ||
|
||
export const Default: PayconicStory = { | ||
render, | ||
args: { | ||
countryCode: 'BE' | ||
} | ||
}; | ||
|
||
export default meta; |
24 changes: 24 additions & 0 deletions
24
packages/lib/storybook/stories/components/Swish.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MetaConfiguration, PaymentMethodStoryProps, StoryConfiguration } from '../types'; | ||
import { QRLoaderConfiguration } from '../../../src/types'; | ||
import { ComponentContainer } from '../ComponentContainer'; | ||
import { Checkout } from '../Checkout'; | ||
import Swish from '../../../src/components/Swish'; | ||
|
||
type SwishStory = StoryConfiguration<QRLoaderConfiguration>; | ||
|
||
const meta: MetaConfiguration<QRLoaderConfiguration> = { | ||
title: 'Components/Swish' | ||
}; | ||
|
||
const render = ({ componentConfiguration, ...checkoutConfig }: PaymentMethodStoryProps<QRLoaderConfiguration>) => ( | ||
<Checkout checkoutConfig={checkoutConfig}>{checkout => <ComponentContainer element={new Swish(checkout, componentConfiguration)} />}</Checkout> | ||
); | ||
|
||
export const Default: SwishStory = { | ||
render, | ||
args: { | ||
countryCode: 'SE' | ||
} | ||
}; | ||
|
||
export default meta; |