aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/feed/feed.component.html
blob: 7f3cb685da4d4ead00ffa25722f369d2d379cd87 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<app-loading *ngIf="!dataArrived"></app-loading>

<main id="feed-page" *ngIf="dataArrived">
	<aside id="profile-bar" class="round-image rounded-border">
		<summary id="profile-info" (click)="goToProfile()">
			<img
				id="profile-bar-profile-pic"
				class="round-image"
				[src]="user.profilePictureURL"
				alt=""
			/>
			<div id="profile-bar-name">
				{{ user.firstName }} {{ user.lastName }}
			</div>
			<div id="profile-bar-username">@{{ user.userName }}</div>
		</summary>
		<button class="submit-btn" (click)="goToSettings()">Settings</button>
		<button class="submit-btn" (click)="logout()">Logout</button>
	</aside>
	<section id="feed-content">
		<nav id="top-bar">
			<img
				id="top-bar-profile-pic"
				class="round-image"
				[src]="user.profilePictureURL"
				alt=""
				(click)="goToProfile()"
			/>
			<form
				id="create-post-form"
				class="rounded-border"
				[formGroup]="createPostFormGroup"
				(ngSubmit)="createPost()"
			>
				<section id="form-inputs">
					<input
						id="top-bar-create-post"
						type="text"
						formControlName="newPostMessage"
						placeholder="What's on your mind?"
					/>
					<input type="submit" style="display: none" />
					<!-- You need this element, so when you press enter the request is sent -->
					<img
						id="attachment-img"
						src="assets/images/paper-clip.png"
					/>
					<input
						id="file-upload"
						type="file"
						formControlName="fileUpload"
						(change)="onFileUpload($event)"
						multiple
					/>
				</section>
				<section class="form-attachments">
					<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>
			</form>
			<img
				id="top-bar-open-chat"
				src="assets/images/feed/chat-pic.png"
				alt=""
			/>
		</nav>
		<section
			id="posts"
			class="scroll-standalone"
			(scroll)="onScroll($event)"
		>
			<div id="no-posts-msg" *ngIf="posts.length === 0">
				None of your friends have posted anything yet!<br />
				Try refreshing your page!
			</div>
			<div *ngFor="let friendPost of posts" class="post">
				<app-post [paramId]="friendPost.postId.toString()"></app-post>
			</div>
		</section>
	</section>
	<app-footer></app-footer>
</main>