Skip to content

Commit deb2ab7

Browse files
authored
Merge pull request #662 from devtron-labs/feat/copy-button
feat: copy button
2 parents fa1bedd + 0d21d46 commit deb2ab7

File tree

10 files changed

+68
-55
lines changed

10 files changed

+68
-55
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.9.8-beta-10",
3+
"version": "1.9.8-beta-11",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/IconV2/ic-key.svg

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { ReactComponent as Check } from '../../Assets/Icon/ic-check.svg'
3131
*/
3232
export const ClipboardButton = ({
3333
content,
34+
initialTippyText = 'Copy',
3435
copiedTippyText = 'Copied!',
3536
duration = 1000,
3637
copyToClipboardPromise,
@@ -94,19 +95,17 @@ export const ClipboardButton = ({
9495
const iconClassName = `icon-dim-${iconSize} dc__no-shrink`
9596

9697
return (
97-
<Tooltip content="Copy" alwaysShowTippyOnHover={!copied}>
98+
<Tooltip content={copied ? copiedTippyText : initialTippyText} alwaysShowTippyOnHover>
9899
{/* TODO: semantically buttons should not be nested; fix later */}
99100
<button
100101
type="button"
101102
className={`dc__outline-none-imp p-0 flex dc__transparent--unstyled dc__no-border ${rootClassName}`}
102103
aria-label={`Copy ${content}`}
103104
onClick={handleCopyContent}
104105
>
105-
<Tooltip content={copiedTippyText} alwaysShowTippyOnHover visible={copied}>
106-
<div className="flex">
107-
{copied ? <Check className={iconClassName} /> : <ICCopy className={iconClassName} />}
108-
</div>
109-
</Tooltip>
106+
<div className="flex">
107+
{copied ? <Check className={iconClassName} /> : <ICCopy className={iconClassName} />}
108+
</div>
110109
</button>
111110
</Tooltip>
112111
)

src/Common/ClipboardButton/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616

1717
export default interface ClipboardProps {
1818
content: string
19+
/**
20+
* tippy text before copying
21+
*/
22+
initialTippyText?: string
23+
/**
24+
* tippy text after copying
25+
*/
1926
copiedTippyText?: string
27+
/**
28+
* reset duration after copying
29+
*/
2030
duration?: number
2131
copyToClipboardPromise?: Promise<void>
2232
rootClassName?: string

src/Shared/Components/DevtronLicenseCard/DevtronLicenseCard.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const DevtronLicenseCard = ({
9090
transformStyle: 'preserve-3d',
9191
transform: 'translateZ(0)',
9292
}}
93+
whileHover={{ scale: 1.05 }}
9394
>
9495
<div className="p-20 flexbox-col dc__content-space flex-grow-1">
9596
<div className="flexbox dc__content-space dc__gap-72">
@@ -98,14 +99,19 @@ export const DevtronLicenseCard = ({
9899
</span>
99100
<Icon name="ic-devtron" color="N900" size={24} />
100101
</div>
101-
<div className="flexbox-col dc__gap-4">
102+
<div className="flexbox-col dc__gap-2">
102103
<div className="flexbox dc__align-items-center dc__gap-6">
103-
<Icon name="ic-key" color={null} size={16} />
104-
<div className="flex dc__gap-4 cn-7 fs-16 fw-5 lh-1-5 cn-9 font-ibm-plex-mono">
104+
<div className="flex dc__gap-2 cn-7 fs-16 fw-5 lh-1-5 cn-9 font-ibm-plex-mono">
105105
<span>&bull;&bull;&bull;&bull;</span>
106106
<span>{licenseSuffix || licenseKey?.slice(-8)}</span>
107107
</div>
108-
{licenseKey && <ClipboardButton content={licenseKey} onClick={onCopyButtonClick} />}
108+
{licenseKey && (
109+
<ClipboardButton
110+
initialTippyText="Copy license key"
111+
content={licenseKey}
112+
onClick={onCopyButtonClick}
113+
/>
114+
)}
109115
</div>
110116
<div className="flexbox dc__align-items-center dc__gap-4 flex-wrap fs-12">
111117
<span className="font-ibm-plex-mono cn-9">{expiryDate}</span>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.license-card {
22

33
.trial-license-badge {
4-
background-color: var(--bg-hover);
4+
background-color: var(--divider-secondary-translucent);
55
letter-spacing: 0.55px;
66
}
77
}

src/Shared/Components/Icon/Icon.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import { ReactComponent as ICInfoFilled } from '@IconsV2/ic-info-filled.svg'
5858
import { ReactComponent as ICInfoOutline } from '@IconsV2/ic-info-outline.svg'
5959
import { ReactComponent as ICJobColor } from '@IconsV2/ic-job-color.svg'
6060
import { ReactComponent as ICK8sJob } from '@IconsV2/ic-k8s-job.svg'
61-
import { ReactComponent as ICKey } from '@IconsV2/ic-key.svg'
6261
import { ReactComponent as ICLdap } from '@IconsV2/ic-ldap.svg'
6362
import { ReactComponent as ICLivspace } from '@IconsV2/ic-livspace.svg'
6463
import { ReactComponent as ICLoginDevtronLogo } from '@IconsV2/ic-login-devtron-logo.svg'
@@ -153,7 +152,6 @@ export const iconMap = {
153152
'ic-info-outline': ICInfoOutline,
154153
'ic-job-color': ICJobColor,
155154
'ic-k8s-job': ICK8sJob,
156-
'ic-key': ICKey,
157155
'ic-ldap': ICLdap,
158156
'ic-livspace': ICLivspace,
159157
'ic-login-devtron-logo': ICLoginDevtronLogo,

src/Shared/Components/LoginBanner/LoginBanner.tsx

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const AnimatedBackground = () => (
2727
r="2000"
2828
fill="#FD0000"
2929
animate={{ scale: [1, 0.9], y: [0, 50] }}
30-
transition={{ duration: 8, repeat: Infinity, repeatType: 'reverse' }}
30+
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
3131
/>
3232
<motion.circle
3333
cx="418"
@@ -39,15 +39,15 @@ const AnimatedBackground = () => (
3939
x: [0, 1000],
4040
rotate: [0, 60],
4141
}}
42-
transition={{ duration: 8, repeat: Infinity, repeatType: 'reverse' }}
42+
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
4343
/>
4444
<motion.circle
4545
cx="418"
4646
cy="2953"
4747
r="1525"
4848
fill="#A412DF"
4949
animate={{ scale: [0.8, 1], x: [0, 50], y: [-100, 200] }}
50-
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
50+
transition={{ duration: 2, repeat: Infinity, repeatType: 'reverse' }}
5151
/>
5252
<motion.circle
5353
cx="418"
@@ -59,7 +59,7 @@ const AnimatedBackground = () => (
5959
x: [0, 1000],
6060
rotate: [0, 60],
6161
}}
62-
transition={{ duration: 8, repeat: Infinity, repeatType: 'reverse' }}
62+
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
6363
/>
6464
<motion.ellipse
6565
cx="759.5"
@@ -68,7 +68,7 @@ const AnimatedBackground = () => (
6868
ry="975"
6969
fill="white"
7070
animate={{ scale: [0.8, 1], x: [0, 50], y: [-100, 200] }}
71-
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
71+
transition={{ duration: 2, repeat: Infinity, repeatType: 'reverse' }}
7272
/>
7373
<motion.path
7474
d="M1449.92 730.265C1649.97 261.314 2460.84 884.083 2656.59 1131.43C2852.35 1378.78 3240.21 2146.55 2913.48 2307.57C2508.24 2507.29 2384.89 1871.7 2116.5 1567.52C1848.1 1263.34 1326.48 1019.64 1449.92 730.265Z"
@@ -79,7 +79,7 @@ const AnimatedBackground = () => (
7979
'M659.5 743.5C527.947 250.927 1702.5 356.5 2267 825.5C2831.5 1294.5 2825.95 1970.73 2476.5 2073.5C1657 2314.5 1824.89 1047.68 1556.5 743.5C1288.11 439.319 769 1153.5 659.5 743.5Z',
8080
],
8181
}}
82-
transition={{ duration: 8, repeat: Infinity, repeatType: 'reverse' }}
82+
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
8383
/>
8484
<motion.circle
8585
cx="1479"
@@ -91,33 +91,50 @@ const AnimatedBackground = () => (
9191
x: [0, 1000],
9292
rotate: [0, 60],
9393
}}
94-
transition={{ duration: 8, repeat: Infinity, repeatType: 'reverse' }}
94+
transition={{ duration: 4, repeat: Infinity, repeatType: 'reverse' }}
9595
/>
9696
</svg>
9797
</motion.div>
9898
)
9999

100100
const LoginBanner = () => {
101101
const [currentIndex, setCurrentIndex] = useState<number>(0)
102+
const [isHovering, setIsHovering] = useState<boolean>(false)
103+
104+
const handleMouseEnter = () => {
105+
setIsHovering(true)
106+
}
107+
108+
const handleMouseLeave = () => {
109+
setIsHovering(false)
110+
}
102111

103112
useEffect(() => {
104113
const testimonialCount = TESTIMONIAL_CARD_DATA.length
105-
const interval = setInterval(() => {
106-
setCurrentIndex((prevIndex) => (prevIndex + 1) % testimonialCount)
107-
}, TESTIMONIAL_CARD_INTERVAL)
114+
let interval: ReturnType<typeof setInterval>
115+
116+
if (!isHovering) {
117+
interval = setInterval(() => {
118+
setCurrentIndex((prevIndex) => (prevIndex + 1) % testimonialCount)
119+
}, TESTIMONIAL_CARD_INTERVAL)
120+
}
108121

109122
return () => {
110-
clearInterval(interval)
123+
if (interval) {
124+
clearInterval(interval)
125+
}
111126
}
112-
}, [])
127+
}, [isHovering])
113128

114129
const { quote, name, designation, iconName } = TESTIMONIAL_CARD_DATA[currentIndex]
115130

116131
return (
117132
<div className="flexbox-col br-12 border__primary dc__position-rel dc__overflow-hidden bg__primary">
118-
<div className="flexbox-col flex-grow-1 pt-32 pl-32 dc__content-space">
119-
<div className="flex h-36 w-130 dc__fill-available-space dc__zi-2">
120-
<Icon name="ic-devtron-header-logo" color="N900" />
133+
<div className="flexbox-col flex-grow-1 dc__content-space">
134+
<div className="pl-32 pt-32">
135+
<div className="flex h-36 w-130 dc__fill-available-space dc__zi-2">
136+
<Icon name="ic-devtron-header-logo" color="N900" />
137+
</div>
121138
</div>
122139
<AnimatedBackground />
123140
<img
@@ -148,6 +165,8 @@ const LoginBanner = () => {
148165
opacity: { duration: 0.75, ease: TRANSITION_EASE_CURVE },
149166
x: { duration: 0.85, ease: TRANSITION_EASE_CURVE },
150167
}}
168+
onMouseEnter={handleMouseEnter}
169+
onMouseLeave={handleMouseLeave}
151170
className="flexbox-col dc__gap-20"
152171
>
153172
<div className="fs-14 fw-4 lh-1-5 cn-9 dc__truncate--clamp-4">{quote}&quot;</div>

src/Shared/Components/LoginBanner/constants.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ export const TESTIMONIAL_CARD_DATA: TestimonialCardConfig[] = [
88
iconName: 'ic-travclan',
99
},
1010
{
11-
quote: 'All these factors ushered a new era in our Tech ecosystem. We started migrating all of our apps on to Devtron and were able to soon onboard 150+ microservices in a matter of few weeks. Earlier we couldn’t have thought of achieving it in months (maybe even quarters 😅).',
11+
quote: 'Migrating to Devtron revolutionized our tech ecosystem. We onboarded 150+ microservices and multiple staging environments in just weeks. Software releases used to be a month long process and now take a week or even a day for some services. Devtron’s efficiency has transformed how we deliver value, setting a new benchmark for agility and speed.',
1212
designation: 'Principal Engineer at Livspace',
1313
name: 'Ankit Agarwal',
1414
iconName: 'ic-livspace',
1515
},
1616
{
17-
quote: "Prior to Devtron, managing multiple environments consistently was a challenge. Devtron's built-in features for consistent configurations across environments have been a huge win for us. We're confident that every deployment is identical, which has reduced discrepancies and improved our application’s resiliency.",
17+
quote: 'Before Devtron, managing environments consistently was a challenge. Its built-in features ensure identical deployments, reducing discrepancies and boosting resiliency. The one-click rollback saved hours of downtime, quickly getting us back on track. Devtron has streamlined our CI/CD pipeline, enabling faster, reliable deployments and cutting operational overhead.',
1818
designation: 'Engineering Manager at Delhivery',
1919
name: 'Vinay Mishra',
2020
iconName: 'ic-delhivery',
2121
},
2222
{
23-
quote: "Devtron has been instrumental in our transition to Kubernetes. Its platform helped us streamline our CI/CD processes, ensuring consistent and secure deployments. We've seen significantly improved our deployment speed and security posture thanks to Devtron's built-in DevSecOps features.",
23+
quote: "Devtron was key to our Kubernetes transition, streamlining CI/CD for consistent, secure deployments. Its built-in DevSecOps features improved deployment speed and security. The user-friendly platform simplifies Kubernetes management. Devtron's focus on security and automation aligns with our goals, and we’re excited to keep leveraging it as we shape electric mobility's future.",
2424
name: 'Sathish Kumar',
2525
designation: 'CloudOps/DevOps Lead at Ather Energy Pvt. Ltd.',
2626
iconName: 'ic-ather',
@@ -32,7 +32,7 @@ export const TESTIMONIAL_CARD_DATA: TestimonialCardConfig[] = [
3232
iconName: 'ic-73strings',
3333
},
3434
{
35-
quote: 'Partnering with Devtron has revolutionized the way we deliver solutions to our customers. Their Kubernetes-native platform has empowered us to automate and scale our deployments, reducing time-to-market and significantly boosting DevOps efficiency.',
35+
quote: 'Partnering with Devtron has revolutionized the way we deliver solutions to our customers. Their Kubernetes-native platform has empowered us to automate and scale our deployments, reducing time-to-market and significantly boosting DevOps efficiency. The collaboration has not only streamlined our processes but also enhanced our ability to serve customers with agility and precision.',
3636
designation: 'CPTO at Apica',
3737
name: 'Ranjan Parthasarathy',
3838
iconName: 'ic-apica',
@@ -44,7 +44,7 @@ export const TESTIMONIAL_CARD_DATA: TestimonialCardConfig[] = [
4444
iconName: 'ic-spinny',
4545
},
4646
{
47-
quote: 'Managing our complex Kubernetes environment used to be a major bottleneck. We were juggling 15+ pre-prod environments, and it felt like we needed to double our DevOps team just to keep up. Then we discovered Devtron and it has completely streamlined our SDLC processes!',
47+
quote: 'Managing our complex Kubernetes environment was a bottleneck, with 15+ pre-prod environments demanding more resources. Devtron streamlined our SDLC, enabling efficient management without extra DevOps hires. Lead times dropped, developers gained self-service access, and onboarding became easy. Devtron has made us more agile and efficient, letting us focus on delivering value.',
4848
designation: 'Director Architect at Tata1MG',
4949
name: 'Pankaj Pandey',
5050
iconName: 'ic-tata1mg',

0 commit comments

Comments
 (0)