Skip to content

Commit

Permalink
Revert "Update portal subscription screen"
Browse files Browse the repository at this point in the history
This reverts commit a6fd1dc, reversing
changes made to 12fe613.
  • Loading branch information
louischan-oursky committed Jun 27, 2023
1 parent 09354a3 commit 08b88fb
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 417 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ resources/portal/static/

# generated code
pkg/lib/webparcel/parcel_gen.go

# OSX
.DS_Store
122 changes: 0 additions & 122 deletions portal/src/graphql/portal/SubscriptionEnterprisePlan.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion portal/src/graphql/portal/SubscriptionPlanCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
padding: 20px;
display: grid;
grid-template-columns: auto;
grid-template-rows: minmax(0, 0.7fr) 160px minmax(0, 1fr);
grid-template-rows: minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
}

.cardTag {
Expand Down
41 changes: 4 additions & 37 deletions portal/src/graphql/portal/SubscriptionPlanCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,14 @@ function BasePriceSection(props: BasePriceSectionProps) {

export interface BasePriceTagProps {
children?: React.ReactNode;
showAsterisk?: boolean;
}

export function BasePriceTag(props: BasePriceTagProps): React.ReactElement {
const { children, showAsterisk = true } = props;
const { children } = props;
return (
<Text block={true} variant="xLarge" className={styles.basePriceTag}>
{children}
{showAsterisk ? (
<span className={styles.basePriceTagRemarks}>*</span>
) : null}
<span className={styles.basePriceTagRemarks}>*</span>
</Text>
);
}
Expand Down Expand Up @@ -177,15 +174,13 @@ export interface CTAProps {
| "downgrade"
| "current"
| "non-applicable"
| "reactivate"
| "contact-us";
| "reactivate";
nextBillingDate?: Date;
disabled?: IButtonProps["disabled"];
onClickSubscribe?: (planName: string) => void;
onClickUpgrade?: (planName: string) => void;
onClickDowngrade?: (planName: string) => void;
onClickReactivate?: () => Promise<void>;
onClickContactUs?: () => void;
reactivateLoading: boolean;
reactivateError: any;
}
Expand All @@ -205,8 +200,7 @@ const CURRENT_BUTTON_THEME: PartialTheme = {
},
};

// eslint-disable-next-line complexity
function CTA_(props: CTAProps): React.ReactElement {
export function CTA(props: CTAProps): React.ReactElement {
const {
appID,
planName,
Expand All @@ -217,7 +211,6 @@ function CTA_(props: CTAProps): React.ReactElement {
onClickUpgrade: onClickUpgradeProps,
onClickDowngrade: onClickDowngradeProps,
onClickReactivate: onClickReactivateProps,
onClickContactUs,
reactivateLoading,
reactivateError,
} = props;
Expand Down Expand Up @@ -511,35 +504,9 @@ function CTA_(props: CTAProps): React.ReactElement {
/>
</>
);
case "contact-us":
return <CTAContactUs onClick={onClickContactUs} disabled={disabled} />;
}
}

function CTAContactUs(props: { onClick?: () => void; disabled?: boolean }) {
const { onClick: onClickContactUsProps, disabled } = props;

const onClickContactUs = useCallback(
(e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
onClickContactUsProps?.();
},
[onClickContactUsProps]
);

return (
<PrimaryButton
className={styles.cta}
onClick={onClickContactUs}
disabled={disabled}
text={<FormattedMessage id="SubscriptionPlanCard.label.contact-us" />}
/>
);
}

export const CTA = Object.assign(CTA_, { ContactUs: CTAContactUs });

function Separator() {
const theme = useTheme();
return (
Expand Down
Loading

0 comments on commit 08b88fb

Please sign in to comment.