Skip to content

Commit 1efb19f

Browse files
committed
chore: remove todos
1 parent fd757e7 commit 1efb19f

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

src/Shared/Components/DevtronLicenseCard/DevtronLicenseCard.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { useEffect, useRef } from 'react'
22
import { animate, motion, useMotionTemplate, useMotionValue, useTransform } from 'framer-motion'
33
import { ClipboardButton, getTTLInHumanReadableFormat } from '@Common/index'
44
import { ReactComponent as ICChatSupport } from '@IconsV2/ic-chat-circle-dots.svg'
5-
import { DevtronLicenseCardProps, ENTERPRISE_SUPPORT_LINK, LicenseStatus } from '@Shared/index'
5+
import {
6+
CONTACT_SUPPORT_LINK,
7+
DevtronLicenseCardProps,
8+
ENTERPRISE_SUPPORT_LINK,
9+
getHandleOpenURL,
10+
LicenseStatus,
11+
} from '@Shared/index'
612
import { Button, ButtonVariantType } from '../Button'
713
import { Icon } from '../Icon'
814
import { getLicenseColorsAccordingToStatus } from './utils'
@@ -55,10 +61,10 @@ export const DevtronLicenseCard = ({
5561
}
5662
}, [])
5763

58-
const diagonalMovement = useTransform<number, number>([rotateX, rotateY], ([newRotateX, newRotateY]) => {
59-
const position: number = newRotateX + newRotateY
60-
return position
61-
})
64+
const diagonalMovement = useTransform<number, number>(
65+
[rotateX, rotateY],
66+
([newRotateX, newRotateY]) => newRotateX + newRotateY,
67+
)
6268
const sheenPosition = useTransform(diagonalMovement, [-5, 5], [-100, 200])
6369

6470
const sheenOpacity = useTransform(sheenPosition, [-100, 50, 200], [0, 0.05, 0])
@@ -89,8 +95,8 @@ export const DevtronLicenseCard = ({
8995
</div>
9096
{licenseKey && <ClipboardButton content={licenseKey} />}
9197
</div>
92-
<div className="flexbox dc__align-items-center dc__gap-4 font-ibm-plex-mono">
93-
<span>{expiryDate}</span>
98+
<div className="flexbox dc__align-items-center dc__gap-4 flex-wrap">
99+
<span className="font-ibm-plex-mono">{expiryDate}</span>
94100
<span></span>
95101
<span style={{ color: textColor }}>{remainingTimeString}</span>
96102
</div>
@@ -116,12 +122,12 @@ export const DevtronLicenseCard = ({
116122
size={16}
117123
/>
118124
</div>
119-
{/* TODO: Add onClick, and common out the button */}
120125
<Button
121126
dataTestId="contact-support"
122127
startIcon={<ICChatSupport />}
123128
text="Contact support"
124129
variant={ButtonVariantType.text}
130+
onClick={getHandleOpenURL(CONTACT_SUPPORT_LINK)}
125131
/>
126132
</div>
127133
)}

src/Shared/Components/Header/HelpNav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ const HelpNav = ({
115115
type="button"
116116
className="dc__transparent help-card__option flexbox dc__align-items-center cn-9 dc__gap-12 fs-14"
117117
onClick={handleOpenLicenseDialog}
118+
data-testid="about-devtron"
118119
>
119120
<Icon name="ic-devtron" color="N600" size={20} />
120121
About Devtron

src/Shared/Components/LoginBanner/LoginBanner.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { motion } from 'framer-motion'
2-
import { useEffect, useMemo, useState } from 'react'
2+
import { useEffect, useState } from 'react'
33
import { Icon } from '../Icon'
44
import { TESTIMONIAL_CARD_DATA, TESTIMONIAL_CARD_INTERVAL, TRANSITION_EASE_CURVE } from './constants'
55

@@ -98,17 +98,17 @@ const AnimatedBackground = () => (
9898

9999
const LoginBanner = () => {
100100
const [currentIndex, setCurrentIndex] = useState<number>(0)
101-
const testimonialCount = useMemo(() => TESTIMONIAL_CARD_DATA.length, [])
102101

103102
useEffect(() => {
103+
const testimonialCount = TESTIMONIAL_CARD_DATA.length
104104
const interval = setInterval(() => {
105105
setCurrentIndex((prevIndex) => (prevIndex + 1) % testimonialCount)
106106
}, TESTIMONIAL_CARD_INTERVAL)
107107

108108
return () => {
109109
clearInterval(interval)
110110
}
111-
}, [testimonialCount])
111+
}, [])
112112

113113
const { quote, name, designation, iconName } = TESTIMONIAL_CARD_DATA[currentIndex]
114114

src/Shared/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,8 +1073,6 @@ export interface DevtronLicenseBaseDTO {
10731073
domain: string | null
10741074
} | null
10751075
license: string | null
1076-
showLicenseData: boolean
1077-
licenseStatusError?: LicenseErrorStruct
10781076
}
10791077

10801078
export type DevtronLicenseDTO<isCentralDashboard extends boolean = false> = DevtronLicenseBaseDTO &
@@ -1085,9 +1083,13 @@ export type DevtronLicenseDTO<isCentralDashboard extends boolean = false> = Devt
10851083
lastName: string | null
10861084
email: string | null
10871085
} | null
1086+
showLicenseData?: never
1087+
licenseStatusError?: never
10881088
}
10891089
: {
10901090
claimedByUserDetails?: never
1091+
showLicenseData: boolean
1092+
licenseStatusError?: LicenseErrorStruct
10911093
})
10921094

10931095
export enum LicenseStatus {

0 commit comments

Comments
 (0)