-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(recurring buy): performance improvements and adding making share…
…d flyout components
- Loading branch information
1 parent
6fca6ce
commit dfdd9fe
Showing
35 changed files
with
262 additions
and
210 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
22 changes: 22 additions & 0 deletions
22
packages/blockchain-info-components/src/Flyouts/Footer.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,22 @@ | ||
import React, { memo } from 'react' | ||
import styled from 'styled-components' | ||
|
||
const Footer = styled.div` | ||
width: 100%; | ||
box-sizing: border-box; | ||
padding: 40px; | ||
@media (max-width: 767px) { | ||
padding: 20px; | ||
} | ||
` | ||
|
||
const FlyoutFooter = (props: Props) => { | ||
return <Footer>{props.children}</Footer> | ||
} | ||
|
||
export type Props = { | ||
children?: React.ReactNode | ||
} | ||
|
||
export default React.memo(FlyoutFooter) |
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
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
16 changes: 16 additions & 0 deletions
16
packages/blockchain-info-components/stories/chapters/flyoutFooter.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,16 @@ | ||
import React from 'react' | ||
|
||
import { FlyoutFooter, Button } from '../../src' | ||
|
||
export default { | ||
title: 'Flyouts/Footer', | ||
component: FlyoutFooter, | ||
} | ||
|
||
export const ButtonFooter = (args) => { | ||
return ( | ||
<FlyoutFooter {...args}> | ||
<Button nature='primary' fullwidth>Continue</Button> | ||
</FlyoutFooter> | ||
) | ||
} |
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
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
12 changes: 12 additions & 0 deletions
12
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuy/sagaRegister.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,12 @@ | ||
import { takeLatest } from 'redux-saga/effects' | ||
|
||
import sagas from './sagas' | ||
import { actions } from './slice' | ||
|
||
export default () => { | ||
const recurringBuySagas = sagas() | ||
|
||
return function* recurringBuySaga() { | ||
yield takeLatest(actions.showModal, recurringBuySagas.showModal) | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ata/components/recurringBuys/selectors.ts → ...data/components/recurringBuy/selectors.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { RootState } from 'data/rootReducer' | ||
|
||
export const getStep = (state: RootState) => state.components.recurringBuys.step | ||
export const getStep = (state: RootState) => state.components.recurringBuy.step | ||
|
||
export default getStep |
24 changes: 24 additions & 0 deletions
24
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuy/slice.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,24 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import { createSlice, PayloadAction } from '@reduxjs/toolkit' | ||
|
||
import { ModalNamesType, ModalOriginType } from 'data/modals/types' | ||
|
||
import { RecurringBuyState, RecurringBuyStepPayload, RecurringBuyStepType } from './types' | ||
|
||
const initialState: RecurringBuyState = { | ||
step: RecurringBuyStepType.INIT_PAGE | ||
} | ||
|
||
const recurringBuySlice = createSlice({ | ||
initialState, | ||
name: 'recurringBuy', | ||
reducers: { | ||
setStep: (state, action: PayloadAction<RecurringBuyStepPayload>) => { | ||
state.step = action.payload.step | ||
}, | ||
showModal: (state, action: PayloadAction<{ origin: ModalOriginType }>) => {} | ||
} | ||
}) | ||
|
||
const { actions, reducer } = recurringBuySlice | ||
export { actions, reducer } |
16 changes: 16 additions & 0 deletions
16
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuy/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,16 @@ | ||
export enum RecurringBuyStepType { | ||
'INIT_PAGE', | ||
'GET_STARTED', | ||
'FREQUENCY', | ||
'CHECKOUT_CONFIRM', | ||
'SUMMARY' | ||
} | ||
|
||
// state | ||
export type RecurringBuyState = { | ||
step: RecurringBuyStepType | ||
} | ||
|
||
export type RecurringBuyStepPayload = { | ||
step: RecurringBuyStepType | ||
} |
2 changes: 0 additions & 2 deletions
2
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuys/actionTypes.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuys/actions.ts
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuys/reducers.ts
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
packages/blockchain-wallet-v4-frontend/src/data/components/recurringBuys/sagaRegister.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.