Skip to content

Commit 629f528

Browse files
authored
Merge pull request #183 from Toastbrot236/footer-fix
Account for null discord invite and owner username + wrap/break owner email address if it's too long
2 parents 8e61241 + c76d123 commit 629f528

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

src/app/api/types/contact-info.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export interface ContactInfo {
22
adminName: string;
33
emailAddress: string;
4-
discordServerInvite: string;
5-
adminDiscordUsername: string;
4+
discordServerInvite: string | null;
5+
adminDiscordUsername: string | null;
66
}

src/app/components/ui/footer.component.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,24 @@ import { RouterLink } from "@angular/router";
7777
<p class="text-3xl">Get In Touch</p>
7878
<a [href]="'mailto:' + instance.contactInfo.emailAddress" class="text-link hover:text-link-hover hover:underline">
7979
<fa-icon class="pr-1" [icon]="faEnvelope"></fa-icon>
80-
Email Us ({{ instance.contactInfo.emailAddress }})
80+
Email Us <span class="word-wrap-and-break">({{ instance.contactInfo.emailAddress }})</span>
8181
</a>
82-
<a [href]="instance.contactInfo.discordServerInvite" class="text-link hover:text-link-hover hover:underline">
83-
<fa-icon class="pr-1" [icon]="faSignIn"></fa-icon>
84-
Join Our Discord Server
85-
</a>
86-
<p>
87-
You can also contact <span class="italic">{{ instance.contactInfo.adminName }}</span> on Discord at <span class="italic">{{ instance.contactInfo.adminDiscordUsername }}</span>
88-
</p>
82+
@if (instance.contactInfo.discordServerInvite != null) {
83+
<a [href]="instance.contactInfo.discordServerInvite" class="text-link hover:text-link-hover hover:underline">
84+
<fa-icon class="pr-1" [icon]="faSignIn"></fa-icon>
85+
Join Our Discord Server
86+
</a>
87+
}
88+
@if (instance.contactInfo.adminDiscordUsername != null) {
89+
<p>
90+
You can also contact <span class="italic">{{ instance.contactInfo.adminName }}</span> on Discord at <span class="italic">{{ instance.contactInfo.adminDiscordUsername }}</span>
91+
</p>
92+
}
93+
@else {
94+
<p>
95+
Server owner: <span class="italic">{{ instance.contactInfo.adminName }}</span>
96+
</p>
97+
}
8998
</div>
9099
</ng-template>
91100

src/app/pages/instance-info/instance-info.component.html

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,27 @@ <h2 class="font-bold text-2xl">Server Information</h2>
2828

2929
<h2 class="font-bold text-2xl">Contact Us</h2>
3030
<p>Owner: <span class="italic">{{ instance.contactInfo.adminName }}</span></p>
31-
<p>Owner Discord username: <span class="italic">{{ instance.contactInfo.adminDiscordUsername }}</span></p>
32-
<p>Discord server invite:
33-
<a [href]="instance.contactInfo.discordServerInvite" class="text-link hover:text-link-hover hover:underline">
34-
{{ instance.contactInfo.discordServerInvite }}
35-
</a>
36-
</p>
31+
32+
@if (instance.contactInfo.adminDiscordUsername != null) {
33+
<p>Owner Discord username: <span class="italic">{{ instance.contactInfo.adminDiscordUsername }}</span></p>
34+
}
35+
@else {
36+
<p>No Discord username of the owner</p>
37+
}
38+
39+
@if (instance.contactInfo.discordServerInvite != null) {
40+
<p>Discord server invite:
41+
<a [href]="instance.contactInfo.discordServerInvite" class="text-link hover:text-link-hover hover:underline">
42+
{{ instance.contactInfo.discordServerInvite }}
43+
</a>
44+
</p>
45+
}
46+
@else {
47+
<p>No Discord server invite</p>
48+
}
49+
3750
<p>Email address:
38-
<a [href]="'mailto:' + instance.contactInfo.emailAddress" class="text-link hover:text-link-hover hover:underline">
51+
<a [href]="'mailto:' + instance.contactInfo.emailAddress" class="text-link hover:text-link-hover hover:underline word-wrap-and-break">
3952
{{instance.contactInfo.emailAddress }}
4053
</a>
4154
</p>

0 commit comments

Comments
 (0)