aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/feed/feed.component.html
blob: fb969da92aa86b7636bc502176dc47c4892425d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<app-navbar></app-navbar>

<app-loading *ngIf="!dataArrived"></app-loading>

<main class="centered-content scroll-standalone under-navbar flex-col flex-justify-start" *ngIf="dataArrived">
	<form id="create-post" class="card flex-col" [formGroup]="createPostFormGroup" (ngSubmit)="createPost()">
		<textarea id="new-post-message" class="faded-slim-border border-bottom-only padding-small" rows="1" formControlName="newPostMessage" placeholder="What's on your mind?"></textarea>
		<section id="attachments-btns" class="flex-row flex-justify-start flex-center-align-children">
			<div class="file-button hover-half-opacity click-effect">
				<img src="/assets/icons/tabler-icon-paperclip.svg">
				<input type="file" formControlName="fileUpload" (change)="onFileUpload($event)" multiple>
			</div>
		</section>
		<section id="new-post-attachments" class="flex-row faded-slim-border border-bottom-only">
			<div *ngFor="let file of files" class="form-attachment">
				{{ file.name ? file.name : 'Attachment' }}
				<div class="remove-form-attachment" (click)="removeAttachment(file.name)"></div>
			</div>
		</section>
		<button class="faded-slim-border padding-small lighter-hover click-effect border-radius-smaller">
			Post
		</button>
	</form>
	<hr class="card-hr">
	<section id="posts" (scroll)="onScroll($event)">
		<div class="text-centered" *ngIf="posts.length === 0">
			None of your friends have posted anything yet!<br>
			Try refreshing your page!
		</div>
		<div *ngFor="let friendPost of posts; let i = index" class="post">
			<app-post [paramId]="friendPost.postId.toString()" [index]="i"></app-post>
		</div>
	</section>
</main>