Skip to content

feat: add icon & support for svg className in draggable button #752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-paper-plane.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion src/Assets/IconV2/ic-sparkle-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Common/DraggableWrapper/DraggableButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import React from 'react'
import { ReactComponent as ICDrag } from '../../Assets/Icon/ic-drag.svg'
import { DraggableButtonProps } from './types'

export default function DraggableButton({ dragClassName }: DraggableButtonProps) {
export default function DraggableButton({ dragClassName, svgClassName = 'fcn-6' }: DraggableButtonProps) {
return (
<button
type="button"
className={`${dragClassName} dc__outline-none-imp dc__no-border p-0 dc__transparent h-20`}
>
<ICDrag className="dc__grabbable icon-dim-20 fcn-6" />
<ICDrag className={`dc__grabbable icon-dim-20 ${svgClassName}`} />
</button>
)
}
1 change: 1 addition & 0 deletions src/Common/DraggableWrapper/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export interface DraggableWrapperProps {
*/
export interface DraggableButtonProps {
dragClassName: string
svgClassName?: string
}
2 changes: 2 additions & 0 deletions src/Shared/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import { ReactComponent as ICOpenBox } from '@IconsV2/ic-open-box.svg'
import { ReactComponent as ICOpenInNew } from '@IconsV2/ic-open-in-new.svg'
import { ReactComponent as ICOpenshift } from '@IconsV2/ic-openshift.svg'
import { ReactComponent as ICOutOfSync } from '@IconsV2/ic-out-of-sync.svg'
import { ReactComponent as ICPaperPlane } from '@IconsV2/ic-paper-plane.svg'
import { ReactComponent as ICPaperPlaneColor } from '@IconsV2/ic-paper-plane-color.svg'
import { ReactComponent as ICPath } from '@IconsV2/ic-path.svg'
import { ReactComponent as ICPencil } from '@IconsV2/ic-pencil.svg'
Expand Down Expand Up @@ -285,6 +286,7 @@ export const iconMap = {
'ic-openshift': ICOpenshift,
'ic-out-of-sync': ICOutOfSync,
'ic-paper-plane-color': ICPaperPlaneColor,
'ic-paper-plane': ICPaperPlane,
'ic-path': ICPath,
'ic-pencil': ICPencil,
'ic-quay': ICQuay,
Expand Down
5 changes: 5 additions & 0 deletions src/Shared/Providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export interface MainContext {
reloadVersionConfig: ReloadVersionConfigTypes
intelligenceConfig: IntelligenceConfig
setIntelligenceConfig: Dispatch<SetStateAction<IntelligenceConfig>>
aiAgentContext: {
path: string
context: Record<string, string>
}
setAIAgentContext: (aiAgentContext: MainContext['aiAgentContext']) => void
}

export interface MainContextProviderProps {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export interface customEnv {
GATEKEEPER_URL?: string
FEATURE_AI_INTEGRATION_ENABLE?: boolean
LOGIN_PAGE_IMAGE?: string
FEATURE_AI_APP_DETAILS_ENABLE?: boolean
}
declare global {
interface Window {
Expand Down