Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/improve registration page (#451)

Thomas Kaul87301ddbd594
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 295a4445fd..fcb0fedf2a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Changed
+
+- Improved the registration page
+
## 1.68.0 - 01.11.2021
### Changed
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html
index 859f353b4a..7c1b2ee801 100644
--- a/apps/client/src/app/components/header/header.component.html
+++ b/apps/client/src/app/components/header/header.component.html
@@ -229,7 +229,13 @@
mat-button
[routerLink]="['/']"
>
- <gf-logo [hideName]="!currentRoute || currentRoute === 'start'"></gf-logo>
+ <gf-logo
+ [hideName]="
+ !currentRoute ||
+ currentRoute === 'register' ||
+ currentRoute === 'start'
+ "
+ ></gf-logo>
</a>
<span class="spacer"></span>
<a
diff --git a/apps/client/src/app/pages/register/register-page.component.ts b/apps/client/src/app/pages/register/register-page.component.ts
index d0f2040b11..e869012ffd 100644
--- a/apps/client/src/app/pages/register/register-page.component.ts
+++ b/apps/client/src/app/pages/register/register-page.component.ts
@@ -1,4 +1,4 @@
-import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { DataService } from '@ghostfolio/client/services/data.service';
@@ -6,6 +6,7 @@ import { TokenStorageService } from '@ghostfolio/client/services/token-storage.s
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { LineChartItem } from '@ghostfolio/ui/line-chart/interfaces/line-chart.interface';
import { format } from 'date-fns';
+import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -20,6 +21,7 @@ import { ShowAccessTokenDialog } from './show-access-token-dialog/show-access-to
export class RegisterPageComponent implements OnDestroy, OnInit {
public currentYear = format(new Date(), 'yyyy');
public demoAuthToken: string;
+ public deviceType: string;
public hasPermissionForSocialLogin: boolean;
public historicalDataItems: LineChartItem[];
@@ -29,8 +31,8 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
- private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
+ private deviceService: DeviceDetectorService,
private dialog: MatDialog,
private router: Router,
private tokenStorageService: TokenStorageService
@@ -45,6 +47,7 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
const { demoAuthToken, globalPermissions } = this.dataService.fetchInfo();
this.demoAuthToken = demoAuthToken;
+ this.deviceType = this.deviceService.getDeviceInfo().deviceType;
this.hasPermissionForSocialLogin = hasPermission(
globalPermissions,
permissions.enableSocialLogin
diff --git a/apps/client/src/app/pages/register/register-page.html b/apps/client/src/app/pages/register/register-page.html
index 91fc4accd4..5806e8f4cc 100644
--- a/apps/client/src/app/pages/register/register-page.html
+++ b/apps/client/src/app/pages/register/register-page.html
@@ -1,30 +1,46 @@
+<div class="intro-container mb-5">
+ <div class="intro-inner-container mx-auto">
+ <div class="h-100 intro w-100"></div>
+ </div>
+</div>
+
<div class="container">
<div class="row">
- <div class="col">
- <h3 class="d-flex justify-content-center mb-3 text-center" i18n>
- Create your Account
- </h3>
- <mat-card class="mb-4">
- <mat-card-content class="text-center">
- <button
- class="d-inline-block"
- color="primary"
+ <div
+ class="align-items-center d-flex flex-column justify-content-center w-100"
+ >
+ <gf-logo size="large"></gf-logo>
+ <p class="lead m-0">Wealth Management Software</p>
+ </div>
+ </div>
+
+ <div class="button-container row">
+ <div class="align-items-center col d-flex justify-content-center">
+ <div class="py-5 text-center">
+ <button
+ class="d-inline-block"
+ color="primary"
+ i18n
+ mat-flat-button
+ [disabled]="!demoAuthToken"
+ (click)="createAccount()"
+ >
+ Create Account
+ </button>
+ <ng-container *ngIf="hasPermissionForSocialLogin">
+ <div
+ class="m-3 text-muted"
i18n
- mat-flat-button
- [disabled]="!demoAuthToken"
- (click)="createAccount()"
+ [ngClass]="{'d-inline': deviceType !== 'mobile' }"
+ >
+ or
+ </div>
+ <a color="accent" href="/api/auth/google" mat-flat-button
+ ><ion-icon class="mr-1" name="logo-google"></ion-icon
+ ><span i18n>Continue with Google</span></a
>
- Create Account
- </button>
- <ng-container *ngIf="hasPermissionForSocialLogin">
- <div class="my-3 text-muted" i18n>or</div>
- <a color="accent" href="/api/auth/google" mat-flat-button
- ><ion-icon class="mr-1" name="logo-google"></ion-icon
- ><span i18n>Continue with Google</span></a
- >
- </ng-container>
- </mat-card-content>
- </mat-card>
+ </ng-container>
+ </div>
</div>
</div>
</div>
diff --git a/apps/client/src/app/pages/register/register-page.scss b/apps/client/src/app/pages/register/register-page.scss
index 5d4e87f30f..c67623e116 100644
--- a/apps/client/src/app/pages/register/register-page.scss
+++ b/apps/client/src/app/pages/register/register-page.scss
@@ -1,3 +1,26 @@
:host {
display: block;
+
+ .button-container {
+ .mat-stroked-button {
+ background-color: var(--light-background);
+ }
+ }
+
+ .intro-container {
+ background-color: #ffffff;
+ margin-top: -5rem;
+
+ .intro-inner-container {
+ aspect-ratio: 16 / 9;
+ max-height: 66vh;
+
+ .intro {
+ background-image: url('/assets/intro.jpg');
+ background-position: top left;
+ background-repeat: no-repeat;
+ background-size: contain;
+ }
+ }
+ }
}