Browse Source

Remove comments and refactor

Carsten Porth 5 years ago
parent
commit
1e5944e13c

+ 0 - 9
app/src/pages/login/login.html

@@ -1,18 +1,9 @@
-<!--
-  Generated template for the LoginPage page.
-
-  See http://ionicframework.com/docs/components/#navigation for more info on
-  Ionic pages and navigation.
--->
 <ion-header>
-
   <ion-navbar>
     <ion-title>Login</ion-title>
   </ion-navbar>
-
 </ion-header>
 
-
 <ion-content padding>
   <button ion-button outline block (click)="login()">Login</button>
 </ion-content>

+ 8 - 17
app/src/pages/login/login.ts

@@ -9,13 +9,6 @@ import {
 import { AuthProvider } from "../../providers/auth/auth";
 import { HomePage } from "../home/home";
 
-/**
- * Generated class for the LoginPage page.
- *
- * See https://ionicframework.com/docs/components/#navigation for more info on
- * Ionic pages and navigation.
- */
-
 @IonicPage()
 @Component({
   selector: "page-login",
@@ -35,18 +28,16 @@ export class LoginPage {
   }
 
   login() {
+    const alertText = {
+      title: "Login failed",
+      subTitle:
+        "Somthing went wrong while trying to log you in. Please try again.",
+      buttons: ["OK"]
+    };
+
     this.authProvider
       .login()
       .then(() => this.navCtrl.setRoot(HomePage))
-      .catch(err =>
-        this.alertCtrl
-          .create({
-            title: "Login failed",
-            subTitle:
-              "Somthing went wrong while trying to log you in. Pleas try again.",
-            buttons: ["OK"]
-          })
-          .present()
-      );
+      .catch(err => this.alertCtrl.create(alertText).present());
   }
 }

+ 0 - 6
app/src/pages/profile/profile.html

@@ -1,9 +1,3 @@
-<!--
-  Generated template for the ProfilePage page.
-
-  See http://ionicframework.com/docs/components/#navigation for more info on
-  Ionic pages and navigation.
--->
 <ion-header>
   <ion-navbar>
     <ion-title>

+ 0 - 7
app/src/pages/profile/profile.ts

@@ -11,13 +11,6 @@ import { TwitterApiProvider } from "../../providers/twitter-api/twitter-api";
 import { P2pStorageIpfsProvider } from "../../providers/p2p-storage-ipfs/p2p-storage-ipfs";
 import { P2pDatabaseGunProvider } from "../../providers/p2p-database-gun/p2p-database-gun";
 
-/**
- * Generated class for the ProfilePage page.
- *
- * See https://ionicframework.com/docs/components/#navigation for more info on
- * Ionic pages and navigation.
- */
-
 @IonicPage()
 @Component({
   selector: "page-profile",

+ 4 - 11
app/src/pages/write-tweet/write-tweet.html

@@ -1,22 +1,15 @@
-<!--
-  Generated template for the WriteTweetPage page.
-
-  See http://ionicframework.com/docs/components/#navigation for more info on
-  Ionic pages and navigation.
--->
 <ion-header>
-
   <ion-navbar>
-    <ion-title>Write a new tweet</ion-title>
+    <ion-title>Tweet something</ion-title>
   </ion-navbar>
-
 </ion-header>
 
-
 <ion-content padding>
-  <ion-label color="primary" *ngIf="retweet">Retweet</ion-label>
+  <!-- Show tweet to retweet or quote (if passed to the page) -->
+  <ion-label *ngIf="retweet" color="primary">Retweet</ion-label>
   <quoted-status *ngIf="retweet" [data]="retweet.data"></quoted-status>
 
+  <!-- Form to write a tweet -->
   <form [formGroup]="tweet" (ngSubmit)="submitTweet()">
     <ion-item class="padding-0">
       <ion-label color="primary" stacked>Your tweet</ion-label>

+ 0 - 7
app/src/pages/write-tweet/write-tweet.ts

@@ -11,13 +11,6 @@ import { Storage } from "@ionic/storage";
 import { P2pStorageIpfsProvider } from "../../providers/p2p-storage-ipfs/p2p-storage-ipfs";
 import { P2pDatabaseGunProvider } from "../../providers/p2p-database-gun/p2p-database-gun";
 
-/**
- * Generated class for the WriteTweetPage page.
- *
- * See https://ionicframework.com/docs/components/#navigation for more info on
- * Ionic pages and navigation.
- */
-
 @IonicPage()
 @Component({
   selector: "page-write-tweet",

+ 0 - 5
app/src/pipes/diff-for-humans/diff-for-humans.ts

@@ -5,11 +5,6 @@ import en from "javascript-time-ago/locale/en";
 TimeAgo.locale(en);
 const timeAgo = new TimeAgo("en-US");
 
-/**
- * Generated class for the DiffForHumansPipe pipe.
- *
- * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
- */
 @Pipe({
   name: "diffForHumans"
 })

+ 1 - 6
app/src/pipes/friendly-number/friendly-number.ts

@@ -1,16 +1,11 @@
 import { Pipe, PipeTransform } from "@angular/core";
 
-/**
- * Generated class for the FriendlyNumberPipe pipe.
- *
- * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
- */
 @Pipe({
   name: "friendlyNumber"
 })
 export class FriendlyNumberPipe implements PipeTransform {
   /**
-   * Takes a value and
+   * Takes a number and formats it using binary prefixes
    */
   transform(value: number, ...args) {
     if (value > 1000000) {

+ 0 - 5
app/src/pipes/high-resolution/high-resolution.ts

@@ -1,10 +1,5 @@
 import { Pipe, PipeTransform } from "@angular/core";
 
-/**
- * Generated class for the HighResolutionPipe pipe.
- *
- * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
- */
 @Pipe({
   name: "highResolution"
 })

+ 0 - 5
app/src/pipes/replace-hashtags/replace-hashtags.ts

@@ -1,10 +1,5 @@
 import { Pipe, PipeTransform } from "@angular/core";
 
-/**
- * Generated class for the ReplaceHashtagsPipe pipe.
- *
- * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
- */
 @Pipe({
   name: "replaceHashtags"
 })

+ 0 - 5
app/src/pipes/replace-urls/replace-urls.ts

@@ -1,10 +1,5 @@
 import { Pipe, PipeTransform } from "@angular/core";
 
-/**
- * Generated class for the ReplaceUrlsPipe pipe.
- *
- * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
- */
 @Pipe({
   name: "replaceUrls"
 })