From 692053e4a0f3d6e78924c0fda7d94a8bc93fdbc6 Mon Sep 17 00:00:00 2001
From: Gcolon021 <34667267+Gcolon021@users.noreply.github.com>
Date: Mon, 7 Oct 2024 16:09:41 -0400
Subject: [PATCH] Update login button appearance and add support for dynamic
images (#245)
The style changes are temporary and will likely be reverted in the
future. The ability to include images will be kept.
---
.../NIH_2013_logo_vertical_text_removed.svg | 48 +++++++++++++++++++
src/lib/components/LoginButton.svelte | 8 ++++
src/lib/models/AuthProvider.ts | 6 +++
.../(authentication)/login/+page.svelte | 4 +-
.../NIH_2013_logo_vertical_text_removed.svg | 48 +++++++++++++++++++
5 files changed, 112 insertions(+), 2 deletions(-)
create mode 100644 src/lib/assets/login/NIH_2013_logo_vertical_text_removed.svg
create mode 100644 static/NIH_2013_logo_vertical_text_removed.svg
diff --git a/src/lib/assets/login/NIH_2013_logo_vertical_text_removed.svg b/src/lib/assets/login/NIH_2013_logo_vertical_text_removed.svg
new file mode 100644
index 00000000..ac648ecb
--- /dev/null
+++ b/src/lib/assets/login/NIH_2013_logo_vertical_text_removed.svg
@@ -0,0 +1,48 @@
+
+
diff --git a/src/lib/components/LoginButton.svelte b/src/lib/components/LoginButton.svelte
index e0075d4c..751c53b4 100644
--- a/src/lib/components/LoginButton.svelte
+++ b/src/lib/components/LoginButton.svelte
@@ -15,6 +15,11 @@
resetSearch();
});
};
+
+ let imageSrc: string | undefined = undefined;
+ if (provider.imagesrc) {
+ imageSrc = './' + provider.imagesrc;
+ }
diff --git a/src/lib/models/AuthProvider.ts b/src/lib/models/AuthProvider.ts
index 90d1346e..80dc69c7 100644
--- a/src/lib/models/AuthProvider.ts
+++ b/src/lib/models/AuthProvider.ts
@@ -9,6 +9,8 @@ export interface AuthData extends Indexable {
helpText?: string;
enabled: boolean;
alt: boolean;
+ imageSrc?: string;
+ imageAlt?: string;
}
export default class AuthProvider implements AuthData {
@@ -21,6 +23,8 @@ export default class AuthProvider implements AuthData {
logouturl?: string | undefined;
callbackurl?: string | undefined;
alt: boolean;
+ imageSrc?: string | undefined;
+ imageAlt?: string | undefined;
constructor(data: AuthData) {
this.name = data.name;
@@ -29,6 +33,8 @@ export default class AuthProvider implements AuthData {
this.icon = data.icon;
this.enabled = data.enabled;
this.alt = data.alt || false;
+ this.imageSrc = data.imagesrc;
+ this.imageAlt = data.imagealt;
}
protected getRedirectURI(): string {
diff --git a/src/routes/(authentication)/login/+page.svelte b/src/routes/(authentication)/login/+page.svelte
index 9d7d898b..ea479cdf 100644
--- a/src/routes/(authentication)/login/+page.svelte
+++ b/src/routes/(authentication)/login/+page.svelte
@@ -68,7 +68,7 @@
provider={selectedProvider}
{redirectTo}
helpText={selectedProvider.helptext}
- class="btn variant-filled-primary m-1 mt-2 w-full"
+ class="btn variant-outline-primary m-1 mt-2 w-full"
/>
{/if}
{:else}
@@ -78,7 +78,7 @@
{provider}
{redirectTo}
helpText={provider.helptext}
- class="btn variant-filled-primary w-full"
+ class="btn variant-outline-primary text-primary-500 w-full"
/>
{/each}
{/if}
diff --git a/static/NIH_2013_logo_vertical_text_removed.svg b/static/NIH_2013_logo_vertical_text_removed.svg
new file mode 100644
index 00000000..ac648ecb
--- /dev/null
+++ b/static/NIH_2013_logo_vertical_text_removed.svg
@@ -0,0 +1,48 @@
+
+