mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 04:11:12 +00:00
Make communities page subscribe buttons look like links
This commit is contained in:
parent
3ba232ea42
commit
6793e3768a
2 changed files with 13 additions and 6 deletions
|
@ -13,6 +13,7 @@ interface SubscribeButtonProps {
|
|||
onFollow: MouseEventHandler;
|
||||
onUnFollow: MouseEventHandler;
|
||||
loading?: boolean;
|
||||
isLink?: boolean;
|
||||
}
|
||||
|
||||
export function SubscribeButton({
|
||||
|
@ -23,6 +24,7 @@ export function SubscribeButton({
|
|||
onFollow,
|
||||
onUnFollow,
|
||||
loading = false,
|
||||
isLink = false,
|
||||
}: SubscribeButtonProps) {
|
||||
let i18key: NoOptionI18nKeys;
|
||||
|
||||
|
@ -44,14 +46,19 @@ export function SubscribeButton({
|
|||
}
|
||||
}
|
||||
|
||||
const buttonClass = "btn d-block mb-2 w-100";
|
||||
const buttonClass = classNames(
|
||||
"btn",
|
||||
isLink ? "btn-link d-inline-block" : "d-block mb-2 w-100",
|
||||
);
|
||||
|
||||
if (!UserService.Instance.myUserInfo) {
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className={classNames(buttonClass, "btn-secondary")}
|
||||
className={classNames(buttonClass, {
|
||||
"btn-secondary": !isLink,
|
||||
})}
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#remoteFetchModal"
|
||||
>
|
||||
|
@ -65,10 +72,9 @@ export function SubscribeButton({
|
|||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={classNames(
|
||||
buttonClass,
|
||||
`btn-${subscribed === "Pending" ? "warning" : "secondary"}`,
|
||||
)}
|
||||
className={classNames(buttonClass, {
|
||||
[`btn-${subscribed === "Pending" ? "warning" : "secondary"}`]: !isLink,
|
||||
})}
|
||||
onClick={subscribed === "NotSubscribed" ? onFollow : onUnFollow}
|
||||
>
|
||||
{loading ? (
|
||||
|
|
|
@ -192,6 +192,7 @@ export class Communities extends Component<any, CommunitiesState> {
|
|||
},
|
||||
this.handleFollow,
|
||||
)}
|
||||
isLink
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue