Skip to content

Commit af0caf2

Browse files
Merge pull request #657 from devtron-labs/feat/license-card-sheen
feat: add sheen for light and dark mode in license card
2 parents dce0275 + f85c1d3 commit af0caf2

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/Shared/Components/DevtronLicenseCard/DevtronLicenseCard.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ClipboardButton, getTTLInHumanReadableFormat } from '@Common/index'
44
import { ReactComponent as ICChatSupport } from '@IconsV2/ic-chat-circle-dots.svg'
55
import { getThemeOppositeThemeClass } from '@Shared/Providers/ThemeProvider/utils'
66
import {
7+
AppThemeType,
78
CONTACT_SUPPORT_LINK,
89
DevtronLicenseCardProps,
910
ENTERPRISE_SUPPORT_LINK,
@@ -32,6 +33,7 @@ export const DevtronLicenseCard = ({
3233
const remainingTime = getTTLInHumanReadableFormat(ttl)
3334
const remainingTimeString = ttl < 0 ? `Expired ${remainingTime} ago` : `${remainingTime} remaining`
3435
const isLicenseValid = licenseStatus !== LicenseStatus.EXPIRED
36+
const isThemeDark = appTheme === AppThemeType.dark
3537

3638
const cardRef = useRef<HTMLDivElement>(null)
3739

@@ -70,12 +72,10 @@ export const DevtronLicenseCard = ({
7072
)
7173
const sheenPosition = useTransform(diagonalMovement, [-5, 5], [-100, 200])
7274

73-
const sheenOpacity = useTransform(sheenPosition, [-100, 50, 200], [0, 0.05, 0])
74-
const sheenGradient = useMotionTemplate`linear-gradient(
75-
55deg,
76-
transparent,
77-
rgba(255 255 255 / ${sheenOpacity}) ${sheenPosition}%,
78-
transparent)`
75+
const sheenOpacity = useTransform(sheenPosition, [-100, 50, 200], [0, isThemeDark ? 0.25 : 0.1, 0])
76+
const sheenGradient = isThemeDark
77+
? useMotionTemplate`linear-gradient(55deg, transparent, rgba(122, 127, 131, ${sheenOpacity}) ${sheenPosition}%, transparent)`
78+
: useMotionTemplate`linear-gradient(55deg, transparent, rgba(255, 255, 255, ${sheenOpacity}) ${sheenPosition}%, transparent)`
7979

8080
return (
8181
<div className="flexbox-col p-8 br-16" style={{ backgroundColor: bgColor }}>
@@ -107,7 +107,7 @@ export const DevtronLicenseCard = ({
107107
</div>
108108
{licenseKey && <ClipboardButton content={licenseKey} onClick={onCopyButtonClick} />}
109109
</div>
110-
<div className="flexbox dc__align-items-center dc__gap-4 flex-wrap">
110+
<div className="flexbox dc__align-items-center dc__gap-4 flex-wrap fs-12">
111111
<span className="font-ibm-plex-mono cn-9">{expiryDate}</span>
112112
<span className="cn-9">·</span>
113113
<span style={{ color: textColor }}>{remainingTimeString}</span>

src/Shared/Components/DevtronLicenseCard/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const parseDevtronLicenseDTOIntoLicenseCardData = <isCentralDashboard ext
3838
licenseDTO || {}
3939

4040
return {
41-
enterpriseName: organisationMetadata?.name || '',
41+
enterpriseName: organisationMetadata?.name || 'Devtron Enterprise',
4242
expiryDate: expiry ? moment(expiry).format(DATE_TIME_FORMATS['DD/MM/YYYY']) : '',
4343
ttl,
4444
licenseStatus: getDevtronLicenseStatus({ ttl, reminderThreshold }),

src/Shared/Helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,14 +1087,14 @@ export const getCentralAPIHealthObjectFromLocalStorage = (): CentralAPILocalConf
10871087
return {
10881088
lastUpdatedDate: lastUpdatedDate || '',
10891089
updateCount: updateCount || 0,
1090-
isConnected: isConnected || null,
1090+
isConnected: isConnected || false,
10911091
}
10921092
} catch {
10931093
localStorage.removeItem(CENTRAL_API_LOCAL_STORAGE_KEY)
10941094
return {
10951095
lastUpdatedDate: '',
10961096
updateCount: 0,
1097-
isConnected: null,
1097+
isConnected: false,
10981098
}
10991099
}
11001100
}

src/Shared/constants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ export const DC_DELETE_SUBTITLES = {
521521
}
522522

523523
export const EULA_LINK = 'https://devtron.ai/end-user-license-agreement-eula'
524-
export const CONTACT_SUPPORT_LINK = 'https://share.hsforms.com/1Yp3bvPAaRCaHUEH5vtMjEQ4368n'
524+
export const CONTACT_SUPPORT_LINK = 'https://devtron.ai/enterprise-support'
525525

526526
export const enum DeleteComponentsName {
527527
Cluster = 'cluster',

0 commit comments

Comments
 (0)