Skip to content

Commit

Permalink
add initials auth features on demo
Browse files Browse the repository at this point in the history
  • Loading branch information
silicia-apps committed Nov 17, 2023
1 parent e2b25f2 commit da26ef3
Show file tree
Hide file tree
Showing 35 changed files with 362 additions and 245 deletions.
4 changes: 2 additions & 2 deletions apps/demo/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<sio-app
<sio-app [environmentInjector]="environmentInjector"
title="Demo"
leftPanelType="push"
righPanelType="none"
Expand All @@ -7,6 +7,6 @@
tabMobilePosition="bottom"
color="primary"
>
<sio-auth-badge slot="left_header" color="secondary"></sio-auth-badge>
<sio-darkmode-toggle slot="left_footer"></sio-darkmode-toggle>

</sio-app>
6 changes: 4 additions & 2 deletions apps/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Component, EnvironmentInjector } from '@angular/core';
import { SioAuthModule } from '@silicia/auth';
import { SioCommonModule, SioCoreLoggerService, Loggable } from '@silicia/core';

@Loggable()
Expand All @@ -7,10 +8,11 @@ import { SioCommonModule, SioCoreLoggerService, Loggable } from '@silicia/core';
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
standalone: true,
imports: [SioCommonModule],
imports: [ SioCommonModule, SioAuthModule],
})
export class AppComponent {
constructor(
public environmentInjector: EnvironmentInjector,
private sioCoreLoggerService: SioCoreLoggerService,
) {
this.sioCoreLoggerService.debug(`[AppComponent][constructor]`);
Expand Down
12 changes: 9 additions & 3 deletions apps/demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import { ApplicationConfig } from '@angular/core';
import { importProvidersFrom } from '@angular/core';
import { IonicRouteStrategy } from '@ionic/angular';
import { SioCoreModule } from '@silicia/core';
import { RouteReuseStrategy, provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { sioAuthRoutes } from '@silicia/auth';
import { PreloadAllModules, RouteReuseStrategy, provideRouter, withDebugTracing, withPreloading } from '@angular/router';
import { environment } from '../environments/environment';
import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
providers: [
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
importProvidersFrom(SioCoreModule.forRoot(environment)),
provideRouter(routes),
provideRouter(
routes,
withPreloading(PreloadAllModules),
withDebugTracing(),
),
provideRouter(sioAuthRoutes)
],
};
7 changes: 6 additions & 1 deletion apps/demo/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ export const routes: Routes = [
path: 'info',
loadComponent: () => import('./info/info.page').then((m) => m.InfoPageComponent),
},
{
path: 'settings',
loadComponent: () => import('./settings/settings.page').then((m) => m.SettingsPageComponent),
},
{
path: '',
redirectTo: 'home',
pathMatch: 'full',
},
];

];
2 changes: 1 addition & 1 deletion apps/demo/src/app/home/home.page.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<sio-page title="Home">
<sio-auth-badge slot="end" type="button" color="none"></sio-auth-badge>
</sio-page>
3 changes: 2 additions & 1 deletion apps/demo/src/app/home/home.page.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Component } from '@angular/core';
import { SioAuthModule } from '@silicia/auth';
import { SioCommonModule } from '@silicia/core';

@Component({
selector: 'sio-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
standalone: true,
imports: [SioCommonModule],
imports: [SioCommonModule, SioAuthModule],
})
export class HomePageComponent {
public html: string;
Expand Down
1 change: 1 addition & 0 deletions apps/demo/src/app/settings/settings.page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<sio-page title="settings"></sio-page>
Empty file.
14 changes: 14 additions & 0 deletions apps/demo/src/app/settings/settings.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import { SioCommonModule } from '@silicia/core';

@Component({
selector: 'sio-settings',
templateUrl: 'settings.page.html',
styleUrls: ['settings.page.scss'],
standalone: true,
imports: [SioCommonModule],
})
export class SettingsPageComponent {
// eslint-disable-next-line @typescript-eslint/no-empty-function
constructor() {}
}
Binary file added apps/demo/src/assets/bg/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/demo/src/assets/i18n/it.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"M_HOME": "Home",
"M_ABOUT": "Info",
"M_INFO": "Info",
"M_SETTINGS": "Opzioni",
"L_LANGUAGE": "test",
"LABEL_APP_TITLE" : "Titolo App"
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if (environment.production) {
enableProdMode();
}

bootstrapApplication(AppComponent, appConfig);
bootstrapApplication(AppComponent, appConfig).catch(e => console.error(e));;
Loading

0 comments on commit da26ef3

Please sign in to comment.