Add a hint as to how to get to your sticker packs from the landing page

Part of #156
This commit is contained in:
Travis Ralston 2018-05-12 23:51:58 -06:00
parent 7a0af05ac4
commit d2c672cf00
3 changed files with 23 additions and 5 deletions

View File

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

View File

@ -1 +1,8 @@
// component styles are encapsulated and only applied to their components // component styles are encapsulated and only applied to their components
.stickerpacks {
position: relative;
top: -15px;
padding-left: 10px;
font-size: 0.8em;
color: #525252;
}

View File

@ -11,6 +11,7 @@ import { IntegrationsApiService } from "../../shared/services/integrations/integ
import { Modal, overlayConfigFactory } from "ngx-modialog"; import { Modal, overlayConfigFactory } from "ngx-modialog";
import { ConfigSimpleBotComponent, SimpleBotConfigDialogContext } from "../../configs/simple-bot/simple-bot.component"; import { ConfigSimpleBotComponent, SimpleBotConfigDialogContext } from "../../configs/simple-bot/simple-bot.component";
import { ToasterService } from "angular2-toaster"; import { ToasterService } from "angular2-toaster";
import { StickerApiService } from "../../shared/services/integrations/sticker-api.service";
const CATEGORY_MAP = { const CATEGORY_MAP = {
"Widgets": ["widget"], "Widgets": ["widget"],
@ -28,6 +29,7 @@ export class RiotHomeComponent {
public isError = false; public isError = false;
public errorMessage: string; public errorMessage: string;
public isRoomEncrypted: boolean; public isRoomEncrypted: boolean;
public hasStickerPacks = false;
private roomId: string; private roomId: string;
private userId: string; private userId: string;
@ -40,6 +42,7 @@ export class RiotHomeComponent {
private scalarApi: ScalarServerApiService, private scalarApi: ScalarServerApiService,
private scalar: ScalarClientApiService, private scalar: ScalarClientApiService,
private integrationsApi: IntegrationsApiService, private integrationsApi: IntegrationsApiService,
private stickerApi: StickerApiService,
private adminApi: AdminApiService, private adminApi: AdminApiService,
private router: Router, private router: Router,
private modal: Modal, private modal: Modal,
@ -188,6 +191,12 @@ export class RiotHomeComponent {
this.isLoading = false; 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.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() { private tryOpenConfigScreen() {