mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-28 23:31:14 +00:00
Modify instances page to not link to blocked instances (#2076)
* Modified instances page to not link to blocked instances, as well as showing allowed and blocked in columns instead of one giant list * Update src/shared/components/home/instances.tsx Co-authored-by: SleeplessOne1917 <abias1122@gmail.com> * Update src/shared/components/home/instances.tsx --------- Co-authored-by: Beehaw Dev <dev@beehaw.dev> Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
This commit is contained in:
parent
fd8d452829
commit
3338887385
2 changed files with 30 additions and 23 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 22637606f4a4455458e64cefe9f5ec33dccb6c52
|
Subproject commit cda65b80a58e24d8d397a835f67b193255e7b806
|
|
@ -94,24 +94,25 @@ export class Instances extends Component<any, InstancesState> {
|
||||||
</h2>
|
</h2>
|
||||||
{this.itemList(instances.linked)}
|
{this.itemList(instances.linked)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="col-md-6">
|
||||||
<div className="row">
|
{instances.allowed && instances.allowed.length > 0 && (
|
||||||
{instances.allowed && instances.allowed.length > 0 && (
|
<>
|
||||||
<div className="col-md-6">
|
<h2 className="h5 mb-3">
|
||||||
<h2 className="h5 mb-3">
|
{I18NextService.i18n.t("allowed_instances")}
|
||||||
{I18NextService.i18n.t("allowed_instances")}
|
</h2>
|
||||||
</h2>
|
{this.itemList(instances.allowed)}
|
||||||
{this.itemList(instances.allowed)}
|
</>
|
||||||
</div>
|
)}
|
||||||
)}
|
|
||||||
{instances.blocked && instances.blocked.length > 0 && (
|
{instances.blocked && instances.blocked.length > 0 && (
|
||||||
<div className="col-md-6">
|
<>
|
||||||
<h2 className="h5 mb-3">
|
<h2 className="h5 mb-3">
|
||||||
{I18NextService.i18n.t("blocked_instances")}
|
{I18NextService.i18n.t("blocked_instances")}
|
||||||
</h2>
|
</h2>
|
||||||
{this.itemList(instances.blocked)}
|
{this.itemList(instances.blocked, false)}
|
||||||
</div>
|
</>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
@ -133,7 +134,7 @@ export class Instances extends Component<any, InstancesState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
itemList(items: Instance[]) {
|
itemList(items: Instance[], link = true) {
|
||||||
return items.length > 0 ? (
|
return items.length > 0 ? (
|
||||||
<div className="table-responsive">
|
<div className="table-responsive">
|
||||||
<table id="instances_table" className="table table-sm table-hover">
|
<table id="instances_table" className="table table-sm table-hover">
|
||||||
|
@ -148,9 +149,15 @@ export class Instances extends Component<any, InstancesState> {
|
||||||
{items.map(i => (
|
{items.map(i => (
|
||||||
<tr key={i.domain}>
|
<tr key={i.domain}>
|
||||||
<td>
|
<td>
|
||||||
<a href={`https://${i.domain}`} rel={relTags}>
|
{link ? (
|
||||||
{i.domain}
|
<a href={`https://${i.domain}`} rel={relTags}>
|
||||||
</a>
|
{" "}
|
||||||
|
{i.domain}{" "}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span> {i.domain} </span>
|
||||||
|
)}
|
||||||
|
;
|
||||||
</td>
|
</td>
|
||||||
<td>{i.software}</td>
|
<td>{i.software}</td>
|
||||||
<td>{i.version}</td>
|
<td>{i.version}</td>
|
||||||
|
|
Loading…
Reference in a new issue