Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero committed Nov 18, 2020
1 parent dd18974 commit 02997af
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 53 deletions.
19 changes: 0 additions & 19 deletions packages/launch/src/focused-launch/go-back-button/index.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions packages/launch/src/focused-launch/go-back-button/style.scss

This file was deleted.

8 changes: 4 additions & 4 deletions packages/launch/src/focused-launch/plan-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { Plans } from '@automattic/data-stores';
import PlansGrid from '@automattic/plans-grid';
import { Title, SubTitle } from '@automattic/onboarding';
import { useHistory } from 'react-router-dom';
import { BackButton } from '@automattic/onboarding';

/**
* Internal dependencies
*/
import { LAUNCH_STORE } from '../../stores';
import GoBackButton from '../go-back-button';

import './style.scss';

Expand All @@ -33,13 +33,13 @@ const PlanDetails: React.FunctionComponent = () => {
history.goBack();
};

const handlePickDomain = () => {
const goBackToSummary = () => {
history.goBack();
};

return (
<div>
<GoBackButton />
<BackButton onClick={ goBackToSummary }>{ __( 'Go back', __i18n_text_domain__ ) }</BackButton>
<div className="focused-launch-plan-details__header">
<div>
<Title>{ __( 'Select a plan', __i18n_text_domain__ ) }</Title>
Expand All @@ -56,7 +56,7 @@ const PlanDetails: React.FunctionComponent = () => {
currentDomain={ domain }
onPlanSelect={ handleSelect }
currentPlan={ selectedPlan }
onPickDomainClick={ handlePickDomain }
onPickDomainClick={ goBackToSummary }
customTagLines={ {
free_plan: __( 'Best for getting started', __i18n_text_domain__ ),
'business-bundle': __( 'Best for small businesses', __i18n_text_domain__ ),
Expand Down
8 changes: 5 additions & 3 deletions packages/plans-grid/src/plans-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import debugFactory from 'debug';
import PlansTable from '../plans-table';
import PlansAccordion from '../plans-accordion';
import PlansDetails from '../plans-details';
import type { CTAVariation, CustomTagLinesMap, PopularBadgeVariation } from '../plans-table/types';
export type { CTAVariation, CustomTagLinesMap, PopularBadgeVariation } from '../plans-table/types';

/**
* Style dependencies
Expand All @@ -35,9 +37,9 @@ export interface Props {
isAccordion?: boolean;
locale: string;
showPlanTaglines?: boolean;
CTAVariation?: 'FULL_WIDTH' | 'NORMAL';
popularBadgeVariation?: 'ON_TOP' | 'NEXT_TO_NAME';
customTagLines?: Record< string, string >;
CTAVariation?: CTAVariation;
popularBadgeVariation?: PopularBadgeVariation;
customTagLines?: CustomTagLinesMap;
}

const PlansGrid: React.FunctionComponent< Props > = ( {
Expand Down
7 changes: 4 additions & 3 deletions packages/plans-grid/src/plans-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { DomainSuggestions } from '@automattic/data-stores';
*/
import PlanItem from './plan-item';
import { PLANS_STORE } from '../constants';
import type { CTAVariation, PopularBadgeVariation, CustomTagLinesMap } from './types';

/**
* Style dependencies
Expand All @@ -24,9 +25,9 @@ export interface Props {
disabledPlans?: { [ planSlug: string ]: string };
locale: string;
showTaglines?: boolean;
CTAVariation?: 'FULL_WIDTH' | 'NORMAL';
popularBadgeVariation: 'ON_TOP' | 'NEXT_TO_NAME';
customTagLines?: Record< string, string >;
CTAVariation?: CTAVariation;
popularBadgeVariation: PopularBadgeVariation;
customTagLines?: CustomTagLinesMap;
}

const PlansTable: React.FunctionComponent< Props > = ( {
Expand Down
5 changes: 3 additions & 2 deletions packages/plans-grid/src/plans-table/plan-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Button } from '@wordpress/components';
import { useViewportMatch } from '@wordpress/compose';
import { __, sprintf } from '@wordpress/i18n';
import type { DomainSuggestions } from '@automattic/data-stores';
import type { CTAVariation, PopularBadgeVariation } from './types';

/**
* Internal dependencies
Expand Down Expand Up @@ -49,8 +50,8 @@ export interface Props {
onToggleExpandAll?: () => void;
allPlansExpanded: boolean;
disabledLabel?: string;
CTAVariation: 'FULL_WIDTH' | 'NORMAL';
popularBadgeVariation: 'ON_TOP' | 'NEXT_TO_NAME';
CTAVariation?: CTAVariation;
popularBadgeVariation?: PopularBadgeVariation;
}

// NOTE: this component is used by PlansAccordion and contains some duplicated code from plans-table/plans-item.tsx
Expand Down
8 changes: 8 additions & 0 deletions packages/plans-grid/src/plans-table/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* External dependencies
*/
import type { Plans } from '@automattic/data-stores';

export type CTAVariation = 'FULL_WIDTH' | 'NORMAL';
export type PopularBadgeVariation = 'ON_TOP' | 'NEXT_TO_NAME';
export type CustomTagLinesMap = Record< Plans.PlanSlug, string >;

0 comments on commit 02997af

Please sign in to comment.