Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
Add a hint as to how to get to your sticker packs from the landing page
Browse files Browse the repository at this point in the history
Part of #156
  • Loading branch information
turt2live committed May 13, 2018
1 parent 7a0af05 commit d2c672c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
12 changes: 7 additions & 5 deletions web/app/riot/riot-home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
</div>

<div *ngIf="!isLoading && !isError">
<div class="stickerpacks" *ngIf="hasStickerPacks">
Looking for your sticker packs? <a routerLink="stickerpicker">Click here</a>.
</div>

<!-- ------------------------ -->
<!-- EMPTY/ENCRYPTED STATES -->
<!-- ------------------------ -->
Expand All @@ -14,9 +18,8 @@ <h4>This room is encrypted</h4>
<strong>Integrations are not encrypted!</strong>
This means that some information about yourself and the
room may be leaked to the bot, bridge, or widget. This information includes the room ID, your display
name,
your username, your avatar, information about Riot, and other similar details. Add integrations with
caution.
name, your username, your avatar, information about Riot, and other similar details. Add integrations
with caution.
</div>
<div class="alert alert-warning" *ngIf="!hasIntegrations() && isRoomEncrypted">
<h4>This room is encrypted</h4>
Expand All @@ -25,8 +28,7 @@ <h4>This room is encrypted</h4>
<div class="alert alert-warning" *ngIf="!hasIntegrations() && !isRoomEncrypted">
<h4>No integrations available</h4>
This room does not have any compatible integrations. Please contact the server owner if you're seeing
this
message.
this message.
</div>

<!-- ------------------------ -->
Expand Down
7 changes: 7 additions & 0 deletions web/app/riot/riot-home/home.component.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
// component styles are encapsulated and only applied to their components
.stickerpacks {
position: relative;
top: -15px;
padding-left: 10px;
font-size: 0.8em;
color: #525252;
}
9 changes: 9 additions & 0 deletions web/app/riot/riot-home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IntegrationsApiService } from "../../shared/services/integrations/integ
import { Modal, overlayConfigFactory } from "ngx-modialog";
import { ConfigSimpleBotComponent, SimpleBotConfigDialogContext } from "../../configs/simple-bot/simple-bot.component";
import { ToasterService } from "angular2-toaster";
import { StickerApiService } from "../../shared/services/integrations/sticker-api.service";

const CATEGORY_MAP = {
"Widgets": ["widget"],
Expand All @@ -28,6 +29,7 @@ export class RiotHomeComponent {
public isError = false;
public errorMessage: string;
public isRoomEncrypted: boolean;
public hasStickerPacks = false;

private roomId: string;
private userId: string;
Expand All @@ -40,6 +42,7 @@ export class RiotHomeComponent {
private scalarApi: ScalarServerApiService,
private scalar: ScalarClientApiService,
private integrationsApi: IntegrationsApiService,
private stickerApi: StickerApiService,
private adminApi: AdminApiService,
private router: Router,
private modal: Modal,
Expand Down Expand Up @@ -188,6 +191,12 @@ export class RiotHomeComponent {
this.isLoading = false;
this.errorMessage = "Unable to set up Dimension. This version of Riot may not supported or there may be a problem with the server.";
});

this.stickerApi.getPacks().then(packs => {
this.hasStickerPacks = packs.length > 0;
}).catch(err => {
console.error(err);
});
}

private tryOpenConfigScreen() {
Expand Down

0 comments on commit d2c672c

Please sign in to comment.