Skip to content
Merged
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
1 change: 1 addition & 0 deletions packages/plugin-infra/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export namespace Plugin.SiteAdaptor {
disabled: boolean
tooltipHint?: React.ReactNode
onClick?: (walletConnectedCallback?: () => void, requiredSupportPluginID?: NetworkPluginID) => void
style?: React.CSSProperties
}) => JSX.Element | null
/**
* Used to order the applications on the board
Expand Down
7 changes: 5 additions & 2 deletions packages/shared/src/UI/components/ApplicationEntry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ interface ApplicationEntryProps {
iconFilterColor?: string
tooltipHint?: React.ReactNode
onClick: () => void
style?: React.CSSProperties
}

export function ApplicationEntry(props: ApplicationEntryProps) {
Expand All @@ -111,6 +112,7 @@ export function ApplicationEntry(props: ApplicationEntryProps) {
tooltipHint,
recommendFeature,
iconFilterColor,
style,
} = props
const { classes, cx } = useStyles({ disabled, iconFilterColor })
const popperProps = useBoundedPopperProps()
Expand All @@ -119,7 +121,7 @@ export function ApplicationEntry(props: ApplicationEntryProps) {
<Button
variant="text"
// do not change to sx. the hover image will be changed in applicationBoxHover
style={{ background: recommendFeature.backgroundGradient }}
style={{ ...style, background: recommendFeature.backgroundGradient }}
disabled={disabled}
className={cx(
classes.recommendFeatureApplicationBox,
Expand All @@ -143,7 +145,8 @@ export function ApplicationEntry(props: ApplicationEntryProps) {
className={cx(classes.applicationBox, disabled ? classes.disabled : classes.applicationBoxHover)}
onClick={disabled ? undefined : onClick}
variant="text"
disabled={disabled}>
disabled={disabled}
style={style}>
<div className={classes.iconWrapper}>{icon}</div>
<TextOverflowTooltip
title={title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function ApplicationBoardPluginsList(props: ApplicationBoardPluginsListProps) {
)
}

function RenderEntryComponent({ application }: { application: Application }) {
function RenderEntryComponent({ application, style }: { application: Application; style?: React.CSSProperties }) {
const Entry = application.entry.RenderEntryComponent!

const ApplicationEntryStatus = useContext(ApplicationEntryStatusContext)
Expand Down Expand Up @@ -252,7 +252,7 @@ function RenderEntryComponent({ application }: { application: Application }) {
})()
// #endregion

return <Entry disabled={disabled} tooltipHint={tooltipHint} onClick={clickHandler} />
return <Entry disabled={disabled} tooltipHint={tooltipHint} onClick={clickHandler} style={style} />
}

interface ApplicationEntryStatusContextProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const useStyles = makeStyles()(() => {

interface Props extends withClasses<'recommendFeatureAppListWrapper'> {
recommendFeatureAppList: Application[]
RenderEntryComponent: (props: { application: Application }) => JSX.Element
RenderEntryComponent: (props: { application: Application; style?: React.CSSProperties }) => JSX.Element
isCarouselReady?: () => boolean | null
setIsHoveringCarousel: (hover: boolean) => void
isHoveringCarousel: boolean
Expand Down Expand Up @@ -105,7 +105,11 @@ export function ApplicationRecommendArea(props: Props) {
</CarouselProvider>
: <Box className={classes.recommendFeatureAppListWrapper}>
{recommendFeatureAppList.map((application) => (
<RenderEntryComponent key={application.entry.ApplicationEntryID} application={application} />
<RenderEntryComponent
key={application.entry.ApplicationEntryID}
application={application}
style={recommendFeatureAppList.length === 1 ? { width: '100%', marginRight: 0 } : undefined}
/>
))}
</Box>
}
Expand Down