-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add CSPR name promotion (#1058)
* add csprName support, update the home page and header, remove unused code * added cspr name support to deploys list * fix e2e tests * fix onboarding e2e tests * add promotion banner for cspr name and cspr name item to the navigation menu
- Loading branch information
Showing
17 changed files
with
1,055 additions
and
15 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createAction } from 'typesafe-actions'; | ||
|
||
export const setShowCSPRNamePromotion = createAction( | ||
'SET_SHOW_CSPR_NAME_PROMOTION' | ||
)<boolean>(); |
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,19 @@ | ||
import { createReducer } from 'typesafe-actions'; | ||
|
||
import { setShowCSPRNamePromotion } from '@background/redux/promotion/actions'; | ||
import { PromotionState } from '@background/redux/promotion/types'; | ||
|
||
const initialState: PromotionState = { | ||
showCSPRNamePromotion: true | ||
}; | ||
|
||
export const reducer = createReducer(initialState).handleAction( | ||
setShowCSPRNamePromotion, | ||
( | ||
state: PromotionState, | ||
action: ReturnType<typeof setShowCSPRNamePromotion> | ||
) => ({ | ||
...state, | ||
showCSPRNamePromotion: action.payload | ||
}) | ||
); |
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,4 @@ | ||
import { RootState } from 'typesafe-actions'; | ||
|
||
export const selectShowCSPRNamePromotion = (state: RootState) => | ||
state.promotion.showCSPRNamePromotion; |
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 @@ | ||
export interface PromotionState { | ||
showCSPRNamePromotion: boolean; | ||
} |
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
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
65 changes: 65 additions & 0 deletions
65
src/libs/ui/components/cspr-name-banner/cspr-name-banner.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,65 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
import styled from 'styled-components'; | ||
|
||
import { setShowCSPRNamePromotion } from '@background/redux/promotion/actions'; | ||
import { dispatchToMainStore } from '@background/redux/utils'; | ||
|
||
import { AlignedFlexRow, SpacingSize } from '@libs/layout'; | ||
|
||
const Container = styled.div` | ||
margin-top: 24px; | ||
height: 108px; | ||
background-image: url('../../../../assets/illustrations/cspr-name-banner.svg'); | ||
`; | ||
|
||
const ButtonsContainer = styled(AlignedFlexRow)` | ||
padding-top: 68px; | ||
padding-left: 16px; | ||
`; | ||
|
||
const WhiteButton = styled.a` | ||
padding: 0 10px; | ||
background-color: ${props => props.theme.color.contentOnFill}; | ||
border-radius: ${props => props.theme.borderRadius.hundred}px; | ||
color: ${props => props.theme.color.contentAction}; | ||
font-size: 12px; | ||
font-weight: 600; | ||
line-height: 24px; | ||
text-decoration: none; | ||
`; | ||
|
||
const DismissButton = styled.div` | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 24px; | ||
color: ${props => props.theme.color.contentOnFill}; | ||
cursor: pointer; | ||
`; | ||
|
||
export const CsprNameBanner = () => { | ||
const { t } = useTranslation(); | ||
|
||
const dismissPromotion = () => { | ||
dispatchToMainStore(setShowCSPRNamePromotion(false)); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<ButtonsContainer gap={SpacingSize.Medium}> | ||
{/* TODO: add url to CSPR.name */} | ||
<WhiteButton href="" target="_blank"> | ||
<Trans t={t}>Get it now</Trans> | ||
</WhiteButton> | ||
<DismissButton onClick={dismissPromotion}> | ||
<Trans t={t}>Dismiss</Trans> | ||
</DismissButton> | ||
</ButtonsContainer> | ||
</Container> | ||
); | ||
}; |
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