Commit 598fed50 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(chore): AOT-compatible Pro routes

1 merge request!507WIP: (feat): Minds Pro (development branch) - Release 3
Pipeline #77446307 running with stages
......@@ -17,6 +17,7 @@ import { BlockListService } from "./common/services/block-list.service";
import { FeaturesService } from "./services/features.service";
import { ThemeService } from "./common/services/theme.service";
import { BannedService } from './modules/report/banned/banned.service';
import { STANDALONE_ROUTES } from './modules/pro/pro.module';
@Component({
moduleId: module.id,
......@@ -55,6 +56,10 @@ export class Minds {
private bannedService: BannedService,
) {
this.name = 'Minds';
if (window.Minds.pro) {
this.router.resetConfig(STANDALONE_ROUTES);
}
}
async ngOnInit() {
......
......@@ -26,54 +26,68 @@ import { ProUnsubscribeModalComponent } from './channel/unsubscribe-modal/modal.
import { ProCategoriesComponent } from "./channel/categories/categories.component";
import { BlogView } from "../blogs/view/view";
const routes: Routes = [];
const routes: Routes = [
{
path: 'pro',
children: [
{
path: '',
component: ProMarketingComponent,
},
{
path: 'settings',
component: ProSettingsComponent,
},
{
path: ':username',
component: ProChannelComponent,
children: [
{
path: '',
component: ProChannelHomeComponent,
},
{
path: 'donate',
component: ProChannelDonateComponent
},
{
path: 'login',
component: ProChannelLoginComponent
},
{
path: ':type',
component: ProChannelListComponent,
},
]
}
]
}
];
const channelRoute = {
component: ProChannelComponent,
children: [
{
path: '',
component: ProChannelHomeComponent,
},
{
path: 'donate',
component: ProChannelDonateComponent
},
{
path: 'login',
component: ProChannelLoginComponent
},
{
path: ':type',
component: ProChannelListComponent,
},
]
};
if (window.Minds.pro) {
routes.push({
export const STANDALONE_ROUTES = [
{
path: '',
...channelRoute
});
}
routes.push({
path: 'pro',
children: [
{
path: '',
component: ProMarketingComponent,
},
{
path: 'settings',
component: ProSettingsComponent,
},
{
path: ':username',
...channelRoute
}
]
});
component: ProChannelComponent,
children: [
{
path: '',
component: ProChannelHomeComponent,
},
{
path: 'donate',
component: ProChannelDonateComponent
},
{
path: 'login',
component: ProChannelLoginComponent
},
{
path: ':type',
component: ProChannelListComponent,
},
]
}
];
@NgModule({
imports: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment