-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from numbersprotocol/feature-capture-wall
Feature capture wall
- Loading branch information
Showing
84 changed files
with
933 additions
and
942 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
}, | ||
"cordova": {}, | ||
"linuxAndroidStudioPath": "/home/username/android-studio/bin/studio.sh" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
47 changes: 47 additions & 0 deletions
47
src/app/components/post-capture-card/post-capture-card.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,47 @@ | ||
<mat-card *transloco="let t"> | ||
<mat-card-header> | ||
<div mat-card-avatar class="post-capture-avatar"></div> | ||
<mat-card-title>User Name</mat-card-title> | ||
<mat-card-subtitle>sent from n hours</mat-card-subtitle> | ||
<span class="toolbar-spacer"></span> | ||
<button mat-icon-button> | ||
<mat-icon>more_vert</mat-icon> | ||
</button> | ||
</mat-card-header> | ||
<img [src]="imageSrc" mat-card-image> | ||
<mat-card-content> | ||
<mat-list dense class="info-list" [class.info-list-show]="openMore"> | ||
<mat-list-item> | ||
<mat-icon mat-list-icon>access_time</mat-icon> | ||
<div mat-line> | ||
<span>{{ t('timestamp') }}</span> | ||
<span class="info-list-content">{{ proof.timestamp | date:'medium' }}</span> | ||
</div> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon mat-list-icon>place</mat-icon> | ||
<div mat-line> | ||
<span>{{ t('address') }}</span> | ||
<span class="info-list-content">877 N Trinity St Eagle Pass, Texas(TX), 78852</span> | ||
</div> | ||
</mat-list-item> | ||
<mat-list-item> | ||
<mat-icon svgIcon="media-id" mat-list-icon></mat-icon> | ||
<div mat-line> | ||
<span>{{ t('mediaId') }}</span> | ||
<span class="info-list-content">abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef</span> | ||
</div> | ||
</mat-list-item> | ||
</mat-list> | ||
<p class="caption-ellipsis mat-body" [class.caption-full]="openMore"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et | ||
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum | ||
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui | ||
officia deserunt mollit anim id est laborum. | ||
</p> | ||
</mat-card-content> | ||
<mat-card-actions [align]="'end'"> | ||
<button (click)="openMore = !openMore" mat-button>{{ t('viewAll') + '...' }}</button> | ||
</mat-card-actions> | ||
</mat-card> |
49 changes: 49 additions & 0 deletions
49
src/app/components/post-capture-card/post-capture-card.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,49 @@ | ||
:host { | ||
display: block; | ||
} | ||
|
||
.toolbar-spacer { | ||
flex: 1 1 auto; | ||
} | ||
|
||
mat-card img { | ||
max-width: initial; | ||
} | ||
|
||
mat-card-content { | ||
margin-bottom: 0; | ||
} | ||
|
||
.post-capture-avatar { | ||
background-image: url("https://gravatar.com/avatar/8db683da3c728970bb776f6cc4048fd2?s=400&d=mp&r=x"); | ||
background-size: cover; | ||
} | ||
|
||
.caption-ellipsis { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
} | ||
|
||
.caption-full { | ||
overflow: visible; | ||
height: auto; | ||
text-overflow: initial; | ||
white-space: initial; | ||
} | ||
|
||
.info-list { | ||
display: none; | ||
} | ||
|
||
.info-list-show { | ||
display: block; | ||
} | ||
|
||
.info-list-content { | ||
width: 60%; | ||
float: right; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
} |
42 changes: 42 additions & 0 deletions
42
src/app/components/post-capture-card/post-capture-card.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,42 @@ | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { MatListModule } from '@angular/material/list'; | ||
import { IonicModule } from '@ionic/angular'; | ||
import { Proof } from 'src/app/services/data/proof/proof'; | ||
import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; | ||
import { PostCaptureCardComponent } from './post-capture-card.component'; | ||
|
||
describe('PostCaptureCardComponent', () => { | ||
let component: PostCaptureCardComponent; | ||
let fixture: ComponentFixture<PostCaptureCardComponent>; | ||
const expectedProof: Proof = { hash: '1234567890abcdef', timestamp: 1604473851208, mimeType: 'image/jpeg' }; | ||
const expectedImageSrc = 'https://picsum.photos/200/300'; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [PostCaptureCardComponent], | ||
imports: [ | ||
IonicModule.forRoot(), | ||
HttpClientTestingModule, | ||
MatCardModule, | ||
MatButtonModule, | ||
MatIconModule, | ||
MatListModule, | ||
getTranslocoModule() | ||
] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PostCaptureCardComponent); | ||
component = fixture.componentInstance; | ||
component.proof = expectedProof; | ||
component.imageSrc = expectedImageSrc; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
src/app/components/post-capture-card/post-capture-card.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,24 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { MatIconRegistry } from '@angular/material/icon'; | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
import { Proof } from 'src/app/services/data/proof/proof'; | ||
|
||
@Component({ | ||
selector: 'app-post-capture-card', | ||
templateUrl: './post-capture-card.component.html', | ||
styleUrls: ['./post-capture-card.component.scss'], | ||
}) | ||
export class PostCaptureCardComponent { | ||
|
||
@Input() proof!: Proof; | ||
@Input() imageSrc!: string; | ||
|
||
openMore = false; | ||
|
||
constructor( | ||
iconRegistry: MatIconRegistry, | ||
sanitizer: DomSanitizer | ||
) { | ||
iconRegistry.addSvgIcon('media-id', sanitizer.bypassSecurityTrustResourceUrl('/assets/icon/media-id.svg')); | ||
} | ||
} |
Oops, something went wrong.