Skip to content

Commit 1e11e53

Browse files
Merge pull request #616 from devtron-labs/feat/theme-confetti
feat: add confetti in confirmation modal and update page header css
2 parents ff7f0c0 + 57b946c commit 1e11e53

File tree

14 files changed

+78
-20
lines changed

14 files changed

+78
-20
lines changed

package-lock.json

Lines changed: 29 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: 2 additions & 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.8.9",
3+
"version": "1.8.9-beta-2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -118,6 +118,7 @@
118118
"jsonpath-plus": "^10.3.0",
119119
"marked": "^13.0.3",
120120
"nanoid": "^3.3.8",
121+
"react-canvas-confetti": "^2.0.7",
121122
"react-codemirror-merge": "4.23.6",
122123
"react-dates": "^21.8.0",
123124
"react-diff-viewer-continued": "^3.4.0",

src/Common/TippyCustomized.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const TippyCustomized = (props: TippyCustomizedProps) => {
115115
{showCloseButton && (
116116
<div className="icon-dim-16 ml-auto">
117117
<CloseIcon
118-
className={`icon-dim-16 cursor ${isWhiteTheme ? 'fcn-9' : 'fcn-0'}`}
118+
className={`icon-dim-16 cursor ${isWhiteTheme ? 'fcn-9' : 'icon-fill__white'}`}
119119
onClick={closeTippy}
120120
/>
121121
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ComponentProps } from 'react'
2+
import Pride from 'react-canvas-confetti/dist/presets/pride'
3+
4+
const Confetti = () => {
5+
const decorateOptions: ComponentProps<typeof Pride>['decorateOptions'] = (options) => ({
6+
...options,
7+
colors: ['#a864fd', '#29cdff', '#78ff44', '#ff718d', '#fdff6a'],
8+
})
9+
10+
return <Pride autorun={{ speed: 60, duration: 500 }} decorateOptions={decorateOptions} />
11+
}
12+
13+
export default Confetti
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Confetti } from './Confetti.component'

src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
2525
import { Backdrop } from '../Backdrop'
2626
import { useConfirmationModalContext } from './ConfirmationModalContext'
2727
import { CustomInput } from '../CustomInput'
28+
import { Confetti } from '../Confetti'
2829
import './confirmationModal.scss'
2930

3031
const ConfirmationModalBody = ({
@@ -38,6 +39,7 @@ const ConfirmationModalBody = ({
3839
handleClose,
3940
shouldCloseOnEscape = true,
4041
isLandscapeView = false,
42+
showConfetti = false,
4143
}: ConfirmationModalBodyProps) => {
4244
const { registerShortcut, unregisterShortcut } = useRegisterShortcut()
4345

@@ -159,6 +161,8 @@ const ConfirmationModalBody = ({
159161
)}
160162
</div>
161163
</motion.div>
164+
165+
{showConfetti && <Confetti />}
162166
</Backdrop>
163167
)
164168
}

src/Shared/Components/ConfirmationModal/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export type ConfirmationModalProps<isConfig extends boolean = false> = PropsWith
9999
* @deprecated Used to extend the width to 500px and remove gap between title and subTitle.
100100
*/
101101
isLandscapeView?: boolean
102+
/**
103+
* @default false
104+
*/
105+
showConfetti?: boolean
102106
}> &
103107
ButtonConfigAndVariantType<isConfig> &
104108
(isConfig extends false

src/Shared/Components/Header/PageHeader.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Tippy from '@tippyjs/react'
1919
import './pageHeader.css'
2020
import ReactGA from 'react-ga4'
2121
import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg'
22-
import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg'
22+
import { ReactComponent as ICCaretDownSmall } from '@Icons/ic-caret-down-small.svg'
2323
import { ReactComponent as Close } from '@Icons/ic-close.svg'
2424
import { ReactComponent as Question } from '@Icons/ic-help-outline.svg'
2525
import { getAlphabetIcon, TippyCustomized, TippyTheme } from '../../../Common'
@@ -143,7 +143,7 @@ const PageHeader = ({
143143
<span className="fs-13 cn-9" data-testid="go-to-get-started">
144144
Help
145145
</span>
146-
<ICCaretDown
146+
<ICCaretDownSmall
147147
style={{ ['--rotateBy' as any]: `${180 * Number(showHelpCard)}deg` }}
148148
className="scn-7 icon-dim-16 rotate pointer"
149149
/>
@@ -155,8 +155,8 @@ const PageHeader = ({
155155
placement="bottom"
156156
visible={showSwitchThemeLocationTippy}
157157
Icon={ICMediumPaintBucket}
158-
iconClass="icon-dim-48 dc__no-shrink"
159-
iconSize={48}
158+
iconClass="icon-dim-40 dc__no-shrink"
159+
iconSize={40}
160160
additionalContent={renderThemePreferenceLocationTippyContent()}
161161
showCloseButton
162162
trigger="manual"
@@ -170,8 +170,8 @@ const PageHeader = ({
170170
onClick={onClickLogoutButton}
171171
className="dc__transparent flex p-4 dc__gap-4 br-18 bg__secondary border__secondary"
172172
>
173-
{getAlphabetIcon(email, 'm-0-imp')}
174-
<ICCaretDown
173+
{getAlphabetIcon(email, 'm-0-imp h-24 w-24-imp')}
174+
<ICCaretDownSmall
175175
className={`scn-7 icon-dim-16 ${showLogOutCard ? 'dc__flip-180' : ''} dc__transition--transform`}
176176
/>
177177
</button>

src/Shared/Components/LogoutCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface LogoutCardType {
2929
}
3030

3131
export const LOGOUT_CARD_BASE_BUTTON_CLASS =
32-
'dc__unset-button-styles dc__content-space px-12 py-6 fs-13 fw-4 lh-20 cursor w-100 flex left br-4'
32+
'dc__unset-button-styles dc__content-space px-12 py-8 fs-13 fw-4 lh-20 cursor w-100 flex left br-4'
3333

3434
const LogoutCard = ({ className, userFirstLetter, setShowLogOutCard, showLogOutCard }: LogoutCardType) => {
3535
const history = useHistory()

src/Shared/Components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,4 @@ export * from './CustomInput'
8383
export * from './InfoBlock'
8484
export * from './CodeEditorWrapper'
8585
export * from './SSOProviderIcon'
86+
export * from './Confetti'

0 commit comments

Comments
 (0)