-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[B2BP-561] - Implementing 'StripeLink' EC inside B2BP (#267)
* Commit migrate StripeLink component * Commit changeset * commit review changes * commit review changes * commit review changes * commit review changes
- Loading branch information
1 parent
897652e
commit 80e1e13
Showing
7 changed files
with
92 additions
and
33 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 @@ | ||
--- | ||
"nextjs-website": minor | ||
--- | ||
|
||
Migrate StripeLink component from EC to B2BP |
58 changes: 58 additions & 0 deletions
58
apps/nextjs-website/react-components/components/StripeLink/StripeLink.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,58 @@ | ||
import { Grid, Stack, Button } from '@mui/material'; | ||
import ContainerRC from '../common/ContainerRC'; | ||
import { EIcon } from '../common/EIcon'; | ||
import { StripeLinkProps } from '../../types/StripeLink/StripeLink.types'; | ||
import { Subtitle } from '../common/Common'; | ||
import { BackgroundColor, ExtraBackgroundColor, TextAlternativeColor, TextColor } from '../common/Common.helpers'; | ||
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; | ||
|
||
const StripeLink = ({ icon, subtitle, theme, buttonText }: StripeLinkProps) => { | ||
const textAlternativeColor = TextAlternativeColor(theme); | ||
const textColorWhiteOnly = TextColor('dark'); | ||
const backgroundColor = BackgroundColor(theme); | ||
const extraBackgroundColor = ExtraBackgroundColor(theme); | ||
|
||
return ( | ||
<ContainerRC background={extraBackgroundColor} py={2}> | ||
<Grid item> | ||
<Stack | ||
direction={{ md: 'row', xs: 'column' }} | ||
justifyContent={{ md: 'flex-start' }} | ||
spacing={3} | ||
alignItems={{ md: 'center', xs: 'flex-start' }} | ||
> | ||
<EIcon | ||
{...icon} | ||
sx={{ | ||
display: { md: 'flex', xs: 'none' }, | ||
visibility: { md: 'visible', xs: 'hidden' }, | ||
color: textColorWhiteOnly, | ||
}} | ||
/> | ||
<Subtitle | ||
variant='body2' | ||
textColor={textColorWhiteOnly} | ||
subtitle={subtitle} | ||
textAlign='left' | ||
/> | ||
{buttonText && ( | ||
<Button | ||
variant="contained" | ||
size="small" | ||
sx={{ | ||
backgroundColor: backgroundColor, | ||
color: textAlternativeColor, | ||
':hover': { backgroundColor: backgroundColor }, | ||
}} | ||
endIcon={<ArrowForwardIcon color="inherit"></ArrowForwardIcon>} | ||
> | ||
{buttonText} | ||
</Button> | ||
)} | ||
</Stack> | ||
</Grid> | ||
</ContainerRC> | ||
); | ||
}; | ||
|
||
export default StripeLink; |
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
9 changes: 9 additions & 0 deletions
9
apps/nextjs-website/react-components/types/StripeLink/StripeLink.types.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { EIconProps } from "../../components/common/EIcon"; | ||
import { Generic } from "../common/Common.types"; | ||
|
||
export interface StripeLinkProps { | ||
theme: 'dark' | 'light'; | ||
subtitle: Generic | string; | ||
icon?: EIconProps; | ||
buttonText?: string; | ||
} |
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