Add logo of popular brands
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-24 16:07:14 +02:00
parent d9f659ce98
commit 96ffc669d7
7 changed files with 41 additions and 1 deletions

View File

@ -27,6 +27,20 @@ pub struct Provider {
pub configuration_url: String,
}
impl Provider {
/// Get the URL where the logo can be located
pub fn logo_url(&self) -> &str {
match self.logo.as_str() {
"gitea" => "/assets/img/brands/gitea.svg",
"gitlab" => "/assets/img/brands/gitlab.svg",
"github" => "/assets/img/brands/github.svg",
"microsoft" => "/assets/img/brands/microsoft.svg",
"google" => "/assets/img/brands/google.svg",
s => s,
}
}
}
impl PartialEq for Provider {
fn eq(&self, other: &Self) -> bool {
self.id.eq(&other.id)