UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: исправление ширины карточек внешних контуров
This commit is contained in:
@@ -84,18 +84,19 @@ type TExternalContourSubscriptionButtonProps = {
|
||||
loading: boolean;
|
||||
onToggle: () => Promise<void>;
|
||||
buttonClassName?: string;
|
||||
iconOnly?: boolean;
|
||||
};
|
||||
|
||||
export const ExternalContourSubscriptionButton = observer(function ExternalContourSubscriptionButton(
|
||||
props: TExternalContourSubscriptionButtonProps
|
||||
) {
|
||||
const { isSubscribed, loading, onToggle, buttonClassName } = props;
|
||||
const { isSubscribed, loading, onToggle, buttonClassName, iconOnly = false } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (isSubscribed === undefined) {
|
||||
return (
|
||||
<Loader>
|
||||
<Loader.Item width="106px" height="40px" />
|
||||
<Loader.Item width={iconOnly ? "40px" : "106px"} height="40px" />
|
||||
</Loader>
|
||||
);
|
||||
}
|
||||
@@ -109,13 +110,14 @@ export const ExternalContourSubscriptionButton = observer(function ExternalConto
|
||||
disabled={loading}
|
||||
size="lg"
|
||||
>
|
||||
{loading ? (
|
||||
<span className="hidden sm:block">{t("common.loading")}</span>
|
||||
) : isSubscribed ? (
|
||||
<span className="hidden sm:block">{t("common.actions.unsubscribe")}</span>
|
||||
) : (
|
||||
<span className="hidden sm:block">{t("common.actions.subscribe")}</span>
|
||||
)}
|
||||
{!iconOnly &&
|
||||
(loading ? (
|
||||
<span className="hidden sm:block">{t("common.loading")}</span>
|
||||
) : isSubscribed ? (
|
||||
<span className="hidden sm:block">{t("common.actions.unsubscribe")}</span>
|
||||
) : (
|
||||
<span className="hidden sm:block">{t("common.actions.subscribe")}</span>
|
||||
))}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user