-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(daffio): create separate footer for docs and add footer to named…
… views enum (#2733)
- Loading branch information
Showing
22 changed files
with
370 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@use 'theme' as daff-theme; | ||
@use 'sass:map'; | ||
|
||
@mixin daffio-footer-theme($theme) { | ||
$gray: daff-theme.daff-map-deep-get($theme, 'core.gray'); | ||
$base: daff-theme.daff-map-deep-get($theme, 'core.base'); | ||
$base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); | ||
$secondary: map.get($theme, secondary); | ||
|
||
.daffio-footer { | ||
border-top: 1px solid daff-theme.daff-illuminate($base, $gray, 2); | ||
|
||
&__copyright { | ||
color: daff-theme.daff-illuminate($base-contrast, $gray, 3); | ||
} | ||
|
||
&__link, | ||
&__social-link { | ||
color: daff-theme.daff-text-contrast($base); | ||
transition: color 0.3s; | ||
|
||
&:hover { | ||
color: daff-theme.daff-illuminate($base-contrast, $gray, 3); | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
apps/daffio/src/app/core/footer/footer/footer.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,17 @@ | ||
<daff-container size="md"> | ||
<div class="daffio-footer__grid"> | ||
<div class="daffio-footer__menu"> | ||
<a routerLink="{{ link.path }}" *ngFor="let link of links" class="daffio-footer__link">{{ link.title }}</a> | ||
<a class="daffio-footer__link" href="https://github.com/sponsors/graycoreio" target="_blank" rel="noopener noreferrer">Sponsor</a> | ||
</div> | ||
<a class="daffio-footer__logo" routerLink="/"> | ||
<daff-branding-logo type="icon"></daff-branding-logo> | ||
</a> | ||
<div class="daffio-footer__social"> | ||
<a *ngFor="let socialLink of socialLinks" [href]="socialLink.link" target="_blank" rel="noopener noreferrer" class="daffio-footer__link"> | ||
<fa-icon [icon]="socialLink.icon" attr.aria-label="{{socialLink.title}} Logo"></fa-icon> <span>{{socialLink.title}}</span> | ||
</a> | ||
</div> | ||
</div> | ||
<daff-branding-copyright class="daffio-footer__copyright"></daff-branding-copyright> | ||
</daff-container> |
82 changes: 82 additions & 0 deletions
82
apps/daffio/src/app/core/footer/footer/footer.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,82 @@ | ||
@use 'utilities' as daff; | ||
|
||
:host { | ||
display: block; | ||
font-size: daff.$small-font-size; | ||
padding: 24px; | ||
|
||
@include daff.breakpoint(big-tablet) { | ||
padding: 64px 48px; | ||
} | ||
|
||
@include daff.breakpoint(small-laptop) { | ||
padding: 64px 0; | ||
} | ||
} | ||
|
||
.daffio-footer { | ||
&__grid { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
gap: 16px; | ||
|
||
@include daff.breakpoint(big-tablet) { | ||
flex-direction: row; | ||
gap: 48px; | ||
} | ||
} | ||
|
||
&__menu { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8px 16px; | ||
justify-content: center; | ||
order: 2; | ||
|
||
@include daff.breakpoint(big-tablet) { | ||
gap: 24px; | ||
justify-content: flex-start; | ||
order: 1; | ||
} | ||
} | ||
|
||
&__logo { | ||
display: flex; | ||
justify-content: center; | ||
width: 48px; | ||
margin: 0 auto; | ||
order: 1; | ||
|
||
@include daff.breakpoint(big-tablet) { | ||
order: 2; | ||
} | ||
} | ||
|
||
&__social { | ||
display: flex; | ||
gap: 8px 16px; | ||
justify-content: center; | ||
order: 3; | ||
|
||
@include daff.breakpoint(big-tablet) { | ||
gap: 24px; | ||
justify-content: flex-end; | ||
} | ||
} | ||
|
||
&__link { | ||
@include daff.embolden(); | ||
@include daff.uppercase(); | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
text-decoration: none; | ||
} | ||
|
||
&__copyright { | ||
display: block; | ||
text-align: center; | ||
margin-top: 32px; | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
apps/daffio/src/app/core/footer/footer/footer.component.spec.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,79 @@ | ||
import { | ||
Component, | ||
DebugElement, | ||
} from '@angular/core'; | ||
import { | ||
ComponentFixture, | ||
TestBed, | ||
waitForAsync, | ||
} from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | ||
|
||
import { | ||
DaffLogoModule, | ||
DaffCopyrightModule, | ||
} from '@daffodil/branding'; | ||
import { DaffContainerModule } from '@daffodil/design/container'; | ||
|
||
import { DaffioFooterComponent } from './footer.component'; | ||
|
||
@Component({ | ||
template: `<daffio-footer></daffio-footer>`, | ||
}) | ||
class WrapperComponent { } | ||
|
||
describe('DaffioFooterComponent', () => { | ||
let wrapper: WrapperComponent; | ||
let component: DaffioFooterComponent; | ||
let de: DebugElement; | ||
let fixture: ComponentFixture<WrapperComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
WrapperComponent, | ||
DaffioFooterComponent, | ||
], | ||
imports: [ | ||
RouterTestingModule, | ||
DaffContainerModule, | ||
DaffLogoModule, | ||
DaffCopyrightModule, | ||
FontAwesomeModule, | ||
], | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(WrapperComponent); | ||
wrapper = fixture.debugElement.componentInstance; | ||
de = fixture.debugElement.query(By.css('daffio-footer')); | ||
component = de.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('should add a class of "daffio-footer" to the host element', () => { | ||
expect(de.classes).toEqual(jasmine.objectContaining({ | ||
'daffio-footer': true, | ||
})); | ||
}); | ||
|
||
it('should show the copyright', () => { | ||
expect(fixture.debugElement.query(By.css('daff-branding-copyright'))).toBeTruthy(); | ||
}); | ||
|
||
describe('on <daff-branding-logo>', () => { | ||
it('should set type="icon"', () => { | ||
const logo = fixture.debugElement.query(By.css('daff-branding-logo')); | ||
|
||
expect(logo.componentInstance.type).toEqual('icon'); | ||
}); | ||
}); | ||
}); |
33 changes: 33 additions & 0 deletions
33
apps/daffio/src/app/core/footer/footer/footer.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,33 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
HostBinding, | ||
} from '@angular/core'; | ||
import { | ||
faGithub, | ||
faDiscord, | ||
} from '@fortawesome/free-brands-svg-icons'; | ||
|
||
import { DAFF_BRANDING_CONSTANTS } from '@daffodil/branding'; | ||
|
||
@Component({ | ||
selector: 'daffio-footer', | ||
templateUrl: './footer.component.html', | ||
styleUrls: ['./footer.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DaffioFooterComponent { | ||
|
||
@HostBinding('class.daffio-footer') class = true; | ||
|
||
links: any[] = [ | ||
{ path: '/why-pwa', title: 'Why PWA' }, | ||
{ path: '/api', title: 'Docs' }, | ||
{ path: '/support', title: 'Support' }, | ||
]; | ||
|
||
socialLinks: any[] = [ | ||
{ link: DAFF_BRANDING_CONSTANTS.REPO_URL, title: 'Github', icon: faGithub }, | ||
{ link: DAFF_BRANDING_CONSTANTS.DISCORD_URL, title: 'Discord', icon: faDiscord }, | ||
]; | ||
} |
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,31 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | ||
|
||
import { | ||
DaffCopyrightModule, | ||
DaffLogoModule, | ||
} from '@daffodil/branding'; | ||
import { DaffContainerModule } from '@daffodil/design/container'; | ||
|
||
import { DaffioFooterComponent } from './footer.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
|
||
FontAwesomeModule, | ||
DaffContainerModule, | ||
DaffLogoModule, | ||
DaffCopyrightModule, | ||
], | ||
declarations: [ | ||
DaffioFooterComponent, | ||
], | ||
exports: [ | ||
DaffioFooterComponent, | ||
], | ||
}) | ||
export class DaffioFooterComponentModule {} |
2 changes: 2 additions & 0 deletions
2
apps/daffio/src/app/core/footer/marketing-footer/marketing-footer.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,2 @@ | ||
<daffio-sub-footer></daffio-sub-footer> | ||
<daffio-footer></daffio-footer> |
Empty file.
11 changes: 11 additions & 0 deletions
11
apps/daffio/src/app/core/footer/marketing-footer/marketing-footer.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,11 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'daffio-marketing-footer', | ||
templateUrl: './marketing-footer.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DaffioMarketingFooterComponent {} |
24 changes: 24 additions & 0 deletions
24
apps/daffio/src/app/core/footer/marketing-footer/marketing-footer.module.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,24 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { DaffioMarketingFooterComponent } from './marketing-footer.component'; | ||
import { DaffioFooterComponentModule } from '../footer/footer.module'; | ||
import { DaffioSubFooterComponentModule } from '../sub-footer/sub-footer.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
|
||
DaffioSubFooterComponentModule, | ||
DaffioFooterComponentModule, | ||
], | ||
declarations: [ | ||
DaffioMarketingFooterComponent, | ||
], | ||
exports: [ | ||
DaffioMarketingFooterComponent, | ||
], | ||
}) | ||
export class DaffioMarketingFooterComponentModule {} |
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
10 changes: 4 additions & 6 deletions
10
apps/daffio/src/app/core/footer/simple-footer/simple-footer.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
Oops, something went wrong.