fix(core): hide readwise setting if not connected (#11107)
This commit is contained in:
@@ -47,8 +47,10 @@ export const IntegrationCardHeader = ({
|
|||||||
className,
|
className,
|
||||||
icon,
|
icon,
|
||||||
onSettingClick,
|
onSettingClick,
|
||||||
|
showSetting = true,
|
||||||
...props
|
...props
|
||||||
}: HTMLAttributes<HTMLHeadElement> & {
|
}: HTMLAttributes<HTMLHeadElement> & {
|
||||||
|
showSetting?: boolean;
|
||||||
onSettingClick?: () => void;
|
onSettingClick?: () => void;
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
}) => {
|
}) => {
|
||||||
@@ -56,7 +58,7 @@ export const IntegrationCardHeader = ({
|
|||||||
<header className={clsx(cardHeader, className)} {...props}>
|
<header className={clsx(cardHeader, className)} {...props}>
|
||||||
<IntegrationCardIcon>{icon}</IntegrationCardIcon>
|
<IntegrationCardIcon>{icon}</IntegrationCardIcon>
|
||||||
<div className={spaceX} />
|
<div className={spaceX} />
|
||||||
<IntegrationSettingIcon onClick={onSettingClick} />
|
{showSetting ? <IntegrationSettingIcon onClick={onSettingClick} /> : null}
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export const ReadwiseIntegration = () => {
|
|||||||
<IntegrationCardHeader
|
<IntegrationCardHeader
|
||||||
icon={<IntegrationTypeIcon type="readwise" />}
|
icon={<IntegrationTypeIcon type="readwise" />}
|
||||||
onSettingClick={handleOpenSetting}
|
onSettingClick={handleOpenSetting}
|
||||||
|
showSetting={!!token}
|
||||||
/>
|
/>
|
||||||
<IntegrationCardContent
|
<IntegrationCardContent
|
||||||
title={t['com.affine.integration.readwise.name']()}
|
title={t['com.affine.integration.readwise.name']()}
|
||||||
|
|||||||
Reference in New Issue
Block a user