Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 14 additions & 33 deletions static/gsApp/views/amCheckout/components/checkoutSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,13 @@ function Receipt({
return (
<div data-test-id="receipt">
<ReceiptSlot />
<ReceiptPaperContainer>
<Container
position="relative"
left="62px"
top="-7px"
width="320px"
overflow="hidden"
>
<ReceiptPaperShadow />
<motion.div
animate={{y: [-600, -575, -400, -380, -360, -340, -7]}}
Expand All @@ -325,7 +331,7 @@ function Receipt({
times: [0.1, 0.2, 0.3, 0.34, 0.36, 0.37, 1],
}}
>
<ReceiptPaper background="primary" border="primary">
<Container background="primary" borderLeft="primary" borderRight="primary">
<Flex direction="column" gap="xl" padding="xl" align="center">
<img src={SentryLogo} alt={t('Sentry logo')} />
<Grid columns="1fr 2fr 1fr" align="center" gap="sm">
Expand Down Expand Up @@ -489,9 +495,9 @@ function Receipt({
<img src={Barcode} alt={t('Barcode')} />
</Flex>
<ZigZagEdge />
</ReceiptPaper>
</Container>
</motion.div>
</ReceiptPaperContainer>
</Container>
</div>
);
}
Expand Down Expand Up @@ -584,13 +590,13 @@ function CheckoutSuccess({
direction={{sm: 'column', md: 'row'}}
>
<Flex direction="column" align={{sm: 'center', md: 'start'}} maxWidth="500px">
<Title size="2xl" as="h1" align="left">
<Heading size="2xl" as="h1" align={{'2xs': 'center', md: 'left'}}>
{contentTitle}
</Title>
</Heading>
<Flex gap="2xl" direction="column" align={{sm: 'center', md: 'start'}}>
<Description variant="muted" size="lg" align="left">
<Text variant="muted" size="lg" align={{'2xs': 'center', md: 'left'}}>
{contentDescription}
</Description>
</Text>
<Flex gap="sm">
<LinkButton
priority="primary"
Expand Down Expand Up @@ -641,18 +647,6 @@ function CheckoutSuccess({

export default CheckoutSuccess;

const Title = styled(Heading)`
@media (max-width: ${p => p.theme.breakpoints.md}) {
text-align: center;
}
`;

const Description = styled(Text)`
@media (max-width: ${p => p.theme.breakpoints.md}) {
text-align: center;
}
`;

const StyledGrid = styled(Grid)`
& > :last-child {
justify-self: end;
Expand All @@ -668,14 +662,6 @@ const ReceiptSlot = styled('div')`
${p => Color(p.theme.black).lighten(0.08).alpha(0.15).toString()} inset;
`;

const ReceiptPaperContainer = styled('div')`
position: relative;
left: 62px;
top: -7px;
width: 320px;
overflow: hidden;
`;

const ReceiptPaperShadow = styled('div')`
position: relative;
z-index: 1000;
Expand All @@ -686,11 +672,6 @@ const ReceiptPaperShadow = styled('div')`
${p => Color(p.theme.black).lighten(0.05).alpha(0.15).toString()};
`;

const ReceiptPaper = styled(Container)`
border-top: none;
border-bottom: none;
`;

const DateSeparator = styled('div')`
border-top: 1px dashed ${p => p.theme.gray500};
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {ExternalLink} from 'sentry/components/core/link';
import {IconCheckmark} from 'sentry/icons';
import type {SVGIconProps} from 'sentry/icons/svgIcon';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';

type Props = {
color?: string;
Expand All @@ -24,7 +23,7 @@ function MoreFeaturesLink({color, legacySize}: Props) {
const MoreLink = styled(ExternalLink)<{color?: string}>`
display: grid;
grid-template-columns: max-content auto;
gap: ${space(1)};
gap: ${p => p.theme.space.md};
align-items: center;
align-content: center;
color: ${p => p.color ?? p.theme.subText};
Expand Down
63 changes: 24 additions & 39 deletions static/gsApp/views/amCheckout/components/unitTypeItem.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
import styled from '@emotion/styled';

import {Container, Grid} from '@sentry/scraps/layout';
import {Text} from '@sentry/scraps/text';

import PanelItem from 'sentry/components/panels/panelItem';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';

type UnitTypeProps = {
description: React.ReactNode;
unitName: React.ReactNode;
weight: string;
};

function UnitColumn({children}: {children: React.ReactNode}) {
return (
<Grid columns="auto max-content" justify="between" align="center" gap="3xl">
{children}
</Grid>
);
}

export default function UnitTypeItem({unitName, description, weight}: UnitTypeProps) {
return (
<UnitTypeContainer>
<UnitColumn>
<UnitName>{unitName}</UnitName>
<UnitTitle>{t('Unit')}</UnitTitle>
<Text size="lg" bold>
{unitName}
</Text>
<Text size="sm" bold uppercase variant="muted">
{t('Unit')}
</Text>
</UnitColumn>
<UnitColumn>
<Description>{description}</Description>
<Weight>{weight}</Weight>
<Text variant="muted">{description}</Text>
<Container alignSelf="start">
<Text size="xl" bold variant="muted">
{weight}
</Text>
</Container>
</UnitColumn>
</UnitTypeContainer>
);
Expand All @@ -28,38 +46,5 @@ export default function UnitTypeItem({unitName, description, weight}: UnitTypePr
const UnitTypeContainer = styled(PanelItem)`
display: grid;
grid-auto-flow: row;
gap: ${space(0.5)};
`;

const UnitColumn = styled('div')`
display: grid;
grid-template-columns: auto max-content;
justify-content: space-between;
align-items: center;
gap: 40px;
`;

const UnitName = styled('div')`
font-weight: 600;
font-size: ${p => p.theme.fontSize.lg};
`;

const Description = styled('p')`
font-size: ${p => p.theme.fontSize.md};
margin-bottom: 0px;
font-weight: normal;
color: ${p => p.theme.subText};
`;

const UnitTitle = styled('div')`
color: ${p => p.theme.subText};
font-size: ${p => p.theme.fontSize.sm};
text-transform: uppercase;
font-weight: 600;
`;

const Weight = styled('div')`
font-size: ${p => p.theme.fontSize.xl};
color: ${p => p.theme.gray500};
align-self: start;
gap: ${p => p.theme.space.xs};
`;
65 changes: 25 additions & 40 deletions static/gsApp/views/amCheckout/components/volumeSliders.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {Fragment} from 'react';
import styled from '@emotion/styled';

import {Flex} from 'sentry/components/core/layout';
import {Text} from '@sentry/scraps/text';

import {Flex, Grid} from 'sentry/components/core/layout';
import RangeSlider from 'sentry/components/forms/controls/rangeSlider';
import {Body, Header, Hovercard} from 'sentry/components/hovercard';
import PanelItem from 'sentry/components/panels/panelItem';
Expand Down Expand Up @@ -151,26 +153,24 @@ function VolumeSliders({
<div>{getPlanCategoryName({plan: activePlan, category})}</div>
</Title>
{eventBucket.price !== 0 && (
<Description>
<div>
{tct('[unitPrice]/[category]', {
category:
category ===
DATA_CATEGORY_INFO[DataCategoryExact.ATTACHMENT].plural
? 'GB'
: getSingularCategoryName({
plan: activePlan,
category,
capitalize: false,
}),
unitPrice,
})}
</div>
</Description>
<Text variant="muted" size="sm">
{tct('[unitPrice]/[category]', {
category:
category ===
DATA_CATEGORY_INFO[DataCategoryExact.ATTACHMENT].plural
? 'GB'
: getSingularCategoryName({
plan: activePlan,
category,
capitalize: false,
}),
unitPrice,
})}
</Text>
)}
</Flex>
<div>
<SpaceBetweenGrid>
<Grid columns="repeat(2, auto)" justify="between">
<VolumeAmount>
{formatReservedWithUnits(
formData.reserved[category] ?? null,
Expand All @@ -188,7 +188,7 @@ function VolumeSliders({
<BillingInterval>/{billingInterval}</BillingInterval>
)}
</div>
</SpaceBetweenGrid>
</Grid>
<RangeSlider
showLabel={false}
name={category}
Expand All @@ -212,18 +212,18 @@ function VolumeSliders({
: undefined
}
/>
<MinMax>
<div>
<Grid columns="repeat(2, auto)" justify="between">
<Text variant="muted" size="sm">
{tct('[min] included', {
min: formatReservedWithUnits(min, category),
})}
</div>
<div>
</Text>
<Text variant="muted" size="sm">
{formatReservedWithUnits(max, category, {
isAbbreviated: !isByteCategory(category),
})}
</div>
</MinMax>
</Text>
</Grid>
</div>
{showTransactionsDisclaimer && (
<span>
Expand Down Expand Up @@ -269,21 +269,6 @@ const Title = styled('label')`
font-size: ${p => p.theme.fontSize.md};
`;

const SpaceBetweenGrid = styled('div')`
display: grid;
grid-template-columns: repeat(2, auto);
justify-content: space-between;
`;

const Description = styled(SpaceBetweenGrid)`
font-size: ${p => p.theme.fontSize.sm};
color: ${p => p.theme.subText};
`;

const MinMax = styled(Description)`
font-size: ${p => p.theme.fontSize.sm};
`;

const BaseRow = styled('div')`
display: grid;
grid-auto-flow: column;
Expand Down
Loading
Loading