Skip to content

Commit

Permalink
feat: text explaining the duration of the coupon
Browse files Browse the repository at this point in the history
  • Loading branch information
AldemirLucas committed Sep 17, 2024
1 parent b072612 commit f22b257
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
32 changes: 27 additions & 5 deletions next/components/molecules/ColumnsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export default function ColumnsTable({
</Tooltip>
</Box>
<Box
display={header.pt === "Nome" ? "flex" : "none"}
display={header.pt === "Nome" ? {base: "none", lg: "flex"} : "none"}
position="absolute"
right="0"
top="0"
Expand Down Expand Up @@ -546,13 +546,14 @@ export default function ColumnsTable({
<Th
role="row"
position="sticky"
left={0}
top="0"
boxSizing="content-box"
alignItems="center"
border="none !important"
backgroundColor="#F7F7F7"
padding="0 !important"
zIndex={5}
zIndex={6}
>
<Box padding="14px 22px 14px 30px" >
<Checkbox
Expand All @@ -569,13 +570,22 @@ export default function ColumnsTable({
width="100%"
backgroundColor="#DEDFE0"
/>
<Box
display={{base: "flex", lg: "none"}}
position="absolute"
right="0"
top="0"
height="100%"
width="1px"
backgroundColor="#DEDFE0"
/>
</Th>
}

<TableHeader
header={headers[0]}
zIndex={5}
left={{base: "none", lg:"0"}}
left={{base: "none", lg:"72px"}}
/>

{headers.map((elm, i) => (
Expand All @@ -594,7 +604,9 @@ export default function ColumnsTable({
{template === "checks" &&
<Td
role="cell"
position="relative"
position="sticky"
left={0}
zIndex={5}
padding="0 !important"
backgroundColor="#FFF"
borderColor="#DEDFE0"
Expand All @@ -609,17 +621,27 @@ export default function ColumnsTable({
onChange={() => handleCheckboxChange(elm.node.name)}
/>
</Box>
<Box
display={{base: "flex", lg: "none"}}
position="absolute"
right="0"
top="0"
height="100%"
width="1px"
backgroundColor="#DEDFE0"
/>
</Td>
}

<TableValue
position="sticky"
left={{base: "none", lg:"0"}}
left={{base: "none", lg:"72px"}}
zIndex="4"
backgroundColor="#FFF"
>
{elm?.node?.name ? elm.node.name : "Não informado"}
<Box
display={{base: "none", lg: "flex"}}
position="absolute"
right="0"
top="0"
Expand Down
2 changes: 1 addition & 1 deletion next/components/molecules/DataInformationQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default function DataInformationQuery({ resource }) {
let user
if(cookies.get("userBD")) user = JSON.parse(cookies.get("userBD"))

if(user?.proSubscriptionStatus === "active") return true
if(user?.internalSubscription?.edges?.[0]?.node?.isActive === true) return true
return false
}

Expand Down
16 changes: 16 additions & 0 deletions next/pages/user/[username].js
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,10 @@ const PlansAndPayment = ({ userData }) => {
if(result?.isValid === false || result?.errors || !result) {
setValueCoupon("")
setErrCoupon(true)
}
if(result?.duration === "repeating" && toggleAnual === true) {
setValueCoupon("")
setErrCoupon(true)
} else {
setCouponInfos(result)
setCoupon(valueCoupon)
Expand Down Expand Up @@ -2059,6 +2063,18 @@ const PlansAndPayment = ({ userData }) => {
}
<TotalToPayDisplay />
</Grid>

{(couponInfos?.duration === "once" || couponInfos?.duration === "repeating") &&
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="16px"
lineHeight="24px"
color="#464A51"
>
A partir do {couponInfos?.duration === "once" && 2} {couponInfos?.duration === "repeating" && couponInfos?.durationInMonths + 1}°{formattedPlanInterval(checkoutInfos?.interval, true)}, o total a pagar será de {checkoutInfos?.amount?.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL', minimumFractionDigits: 2 })}/{formattedPlanInterval(checkoutInfos?.interval, true)}.
</Text>
}
</Stack>

<Box display="flex" flexDirection="column" gap="24px" flex={1}>
Expand Down

0 comments on commit f22b257

Please sign in to comment.