-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openchallenges): add link to our Discord server to the OC navbar (…
…#2283) * Add Discord button to the navbar * Cleanup * Add target property to link
- Loading branch information
1 parent
c7cb268
commit 96dddc8
Showing
8 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
libs/openchallenges/assets/src/assets/images/discord-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
libs/openchallenges/ui/src/lib/discord-button/_discord-button-theme.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@use 'sass:map'; | ||
@use '@angular/material' as mat; | ||
|
||
@mixin color($theme) { | ||
$config: mat.get-color-config($theme); | ||
$primary: map.get($config, primary); | ||
$accent: map.get($config, accent); | ||
$warn: map.get($config, warn); | ||
$background: map.get($config, background); | ||
$foreground: map.get($config, foreground); | ||
|
||
// add color-related scss here | ||
} | ||
|
||
@mixin typography($theme) {} | ||
|
||
@mixin theme($theme) { | ||
$color-config: mat.get-color-config($theme); | ||
@if $color-config != null { | ||
@include color($theme); | ||
} | ||
|
||
$typography-config: mat.get-typography-config($theme); | ||
@if $typography-config != null { | ||
@include typography($theme); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
libs/openchallenges/ui/src/lib/discord-button/discord-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a | ||
mat-button | ||
class="docs-button" | ||
[href]="href" | ||
aria-label="OpenChallenges Discord server" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<img | ||
alt="OpenChallenges Discord server" | ||
class="discord-logo" | ||
src="/openchallenges-assets/images/discord-icon.svg" | ||
/> | ||
{{ label }} | ||
</a> |
5 changes: 5 additions & 0 deletions
5
libs/openchallenges/ui/src/lib/discord-button/discord-button.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.discord-logo { | ||
height: 21px; | ||
margin: 0 7px 2px 0; | ||
vertical-align: middle; | ||
} |
15 changes: 15 additions & 0 deletions
15
libs/openchallenges/ui/src/lib/discord-button/discord-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, Input } from '@angular/core'; | ||
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button'; | ||
|
||
@Component({ | ||
selector: 'openchallenges-discord-button', | ||
standalone: true, | ||
imports: [CommonModule, MatButtonModule], | ||
templateUrl: './discord-button.component.html', | ||
styleUrls: ['./discord-button.component.scss'], | ||
}) | ||
export class DiscordButtonComponent { | ||
@Input({ required: false }) label = 'Discord'; | ||
@Input({ required: false }) href = 'https://discord.gg/6PGt7nkcwG'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters