Commit bde794d5 authored by XFT's avatar XFT
Browse files

.

parent 67aa780a
Pipeline #28 failed with stages
in 0 seconds
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": [
"const",
"let",
"var"
],
"next": "*"
},
{
"blankLine": "any",
"prev": [
"const",
"let",
"var"
],
"next": [
"const",
"let",
"var"
]
},
{
"blankLine": "always",
"prev": "*",
"next": "block"
},
{
"blankLine": "always",
"prev": "block",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "block-like"
},
{
"blankLine": "always",
"prev": "block-like",
"next": "*"
}
],
"function-paren-newline": [
"off"
],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"semi": [
"error",
"always"
],
"max-len": [
"error",
{
"code": 120
}
],
"quotes": [
"error",
"single"
],
"comma-dangle": [
"error",
"only-multiline"
],
"object-curly-spacing": [
"error",
"always"
],
"arrow-parens": [
"error",
"always"
],
"linebreak-style": [
"off"
],
"no-multiple-empty-lines": [
"error"
],
"space-before-blocks": [
"error"
],
"no-var": [
"error"
],
"no-duplicate-imports": [
"error"
],
"no-prototype-builtins": [
"off"
],
"@typescript-eslint/no-unsafe-assignment": [
"off"
],
"@typescript-eslint/no-inferrable-types": [
"off"
],
"@angular-eslint/no-output-rename": [
"off"
],
"@angular-eslint/no-output-on-prefix": [
"off"
],
"@typescript-eslint/no-floating-promises": [
"off"
],
"@typescript-eslint/unbound-method": [
"off"
],
"@typescript-eslint/no-empty-function": [
"off"
],
"@typescript-eslint/no-unsafe-member-access": [
"off"
],
"@typescript-eslint/no-unsafe-call": [
"off"
],
"@typescript-eslint/no-explicit-any": [
"off"
],
"@typescript-eslint/no-unsafe-return": [
"off"
],
"@typescript-eslint/explicit-module-boundary-types": [
"off"
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "explicit",
"overrides": {
"accessors": "explicit",
"constructors": "no-public",
"methods": "explicit",
"properties": "explicit",
"parameterProperties": "explicit"
}
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "os",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "os",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
},
{
"files": [
"*.ts"
],
"extends": [
"plugin:ngrx/recommended"
]
}
]
}
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
node_modules
npm-debug.log
yarn-error.log
package-lock.json
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db
#package-lock.json
.vscode/launch.json
server/snark_files/response_*
server/db.development.sqlite
server/snark_files/current.params
v16.17.0
\ No newline at end of file
FROM node:16.14.2-alpine as builder
WORKDIR /offshift
COPY . /offshift/
RUN npm install --force
RUN npm run build:prod
FROM nginx:1.21.6-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /offshift/dist /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
# OffshiftFe
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.6.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
## Docker
### Frontend
`docker build -t offshift-frontend .`
`docker run -p 8080:80 offshift-frontend`
### Client
`docker build -t offshift-client .`
`docker run -p 10000:10000 offshift-client`
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"offshift-fe": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss",
"changeDetection": "OnPush"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "os",
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js"
},
"outputPath": "dist/offshift-fe",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/primeicons/primeicons.css",
"./node_modules/primeng/resources/primeng.min.css",
"src/styles.scss"
],
"scripts": [
"./node_modules/chart.js/dist/chart.min.js"
],
"allowedCommonJsDependencies": [
"core-js/modules/es.array.filter",
"core-js/modules/es.array.for-each",
"core-js/modules/es.array.iterator",
"core-js/modules/es.array.reduce",
"core-js/modules/es.function.name",
"core-js/modules/es.object.assign",
"core-js/modules/es.object.to-string",
"core-js/modules/es.parse-int",
"core-js/modules/es.regexp.exec",
"core-js/modules/es.string.iterator",
"core-js/modules/es.string.match",
"core-js/modules/es.string.replace",
"core-js/modules/es.weak-map",
"core-js/modules/web.dom-collections.iterator",
"web3",
"hash.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "25mb",
"maximumError": "50mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "10kb",
"maximumError": "12kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "offshift-fe:build"
},
"configurations": {
"production": {
"browserTarget": "offshift-fe:build:production"
},
"development": {
"browserTarget": "offshift-fe:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "offshift-fe:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "offshift-fe",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/offshift-fe'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
server {
listen 80;
sendfile on;
default_type application/octet-stream;
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1000;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html =404;
}
}
{
"name": "offshift-fe",
"version": "0.0.0",
"scripts": {
"ng": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng",
"start": "npm run ng -- serve --port 4315",
"pilot-UNSAFE": "npm run ng -- serve --port 80 --host 0.0.0.0 --public-host 0.0.0.0 --no-live-reload",
"build": "npm run ng -- build",
"build:prod": "npm run ng -- build --output-path=dist",
"watch": "npm run ng -- build --watch --configuration development",
"test": "ng test",
"lint": "ng lint",
"lint:fix": "ng lint --fix",
"ceremony": "node ./server/index.js"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.3.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@ethersproject/address": "^5.6.0",
"@fontsource/material-icons": "^4.5.2",
"@fontsource/metropolis": "^4.5.1",
"@metamask/jazzicon": "^2.0.0",
"@ngrx/component": "^13.0.2",
"@ngrx/effects": "^13.0.2",
"@ngrx/entity": "^13.0.2",
"@ngrx/router-store": "^13.0.2",
"@ngrx/store": "^13.0.2",
"@ngrx/store-devtools": "^13.0.2",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@types/node": "^16.0.0",
"@uiowa/digit-only": "^3.2.1",
"@walletconnect/web3-provider": "^1.7.5",
"arraybuffer-loader": "^1.0.8",
"bignumber.js": "^9.0.2",
"chart.js": "^3.7.1",
"circom": "^0.0.35",
"circomlib-backup": "^0.0.23",
"circomlibjs": "0.1.2",
"crypto": "^1.0.1",
"filereader": "^0.10.3",
"fixed-merkle-tree-backup": "^0.6.5",
"inquirer": "^8.0.0",
"primeicons": "^5.0.0",
"primeng": "^13.2.1",
"rxjs": "~7.5.0",
"simplebar-angular": "^2.3.6",
"snarkjs-backup": "^0.1.21",
"ts-node": "^10.0.0",
"tslib": "^2.3.0",
"web3": "^1.7.1",
"web3-eth-contract": "^1.7.1",
"web3-utils": "^1.7.1",
"web3modal": "^1.9.5",
"websnark-backup": "^0.0.10",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^13.1.0",
"@angular-devkit/build-angular": "~13.2.6",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "~13.2.6",
"@angular/compiler-cli": "~13.2.0",
"@types/jasmine": "~3.10.0",
"@types/node": "^16.0.0",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"assert": "^2.0.0",
"browser": "^0.2.6",
"crypto-browserify": "^3.12.0",
"eslint": "^8.2.0",
"eslint-plugin-ngrx": "^2.0.0",
"https-browserify": "^1.0.0",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"os-browserify": "^0.3.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"ts-node": "^10.0.0",
"typescript": "~4.5.2",
"url": "^0.11.0",
"webpack": "^5.74.0"
},
"browser": {
"fs": false,
"path": false,
"os": false
}
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const ROUTES: Routes = [
{
path: '',
redirectTo: 'shift',
pathMatch: 'full',
},
{
path: 'shift',
loadChildren: () =>
import('./views/swap/swap.module').then((m) => m.SwapModule),
},
{
path: 'transfer',
loadChildren: () =>
import('./views/transfer/transfer.module').then((m) => m.TransferModule),
},
{
path: 'vault',
loadChildren: () =>
import('./views/wallet/wallet.module').then((m) => m.WalletModule),
},
{
path: 'mpc',
loadChildren: () =>
import('./views/mpc/mpc.module').then((m) => m.MpcModule),
},
{
path: 'swap',
loadChildren: () =>
import('./views/upgrade/upgrade.module').then((m) => m.UpgradeModule),
},
{
path: 'stake',
loadChildren: () =>
import('./views/stake/stake.module').then((m) => m.StakeModule),
},
{
path: 'error',
loadChildren: () =>
import('./views/error/error.module').then((m) => m.ErrorModule),
},
{
path: '**',
redirectTo: '/error',
},
];
@NgModule({
imports: [RouterModule.forRoot(ROUTES, {useHash: true})],
exports: [RouterModule],
})
export class AppRoutingModule {}
<div class="wrapper">
<p-menubar [model]="menuItems" *ngIf="isPhonePortrait">
<div style="text-align: center; margin-right: 1.5rem;">
<img src="assets/images/logo.svg" alt="offshift" style="max-width: 40%;">
</div>
</p-menubar>
<div class="wrapper__header header" *ngIf="!hideNavBar">
<div class="header__left">
<img src="assets/images/logo.svg" alt="offshift">
</div>
<div class="header__center">
<a routerLink="/shift" routerLinkActive="active">Shift</a>
<a routerLink="/vault" routerLinkActive="active">Vault</a>
<a routerLink="/swap" routerLinkActive="active">Token Swap</a>
<a routerLink="/stake" routerLinkActive="active">Stake</a>
</div>
<div class="header__right">
<os-connect-wallet class="header__connect"></os-connect-wallet>
<!--<div class="header__switch">
<span [class.is-active]="!isDarkTheme" class="material-icons light-mode">light_mode</span>
<span [class.is-active]="isDarkTheme" class="material-icons dark-mode">dark_mode</span>
<p-inputSwitch [(ngModel)]="isDarkTheme"></p-inputSwitch>
</div>-->
</div>
</div>
<div [ngClass]="{'wrapper__content': !isPhonePortrait, 'phone-portrait-app': isPhonePortrait}">
<router-outlet></router-outlet>
</div>
</div>
@use "sass:math";
@import "~src/styles/variables";
:host {
display: block;
position: relative;
}
.phone-portrait-app{
padding: 0 5vw;
}
.wrapper {
display: flex;
flex-direction: column;
& &__header {
height: 4.5rem;
background: #FFFFFF;
}
& &__content {
padding: $offshift-gap 5rem;
}
}
.header {
display: flex;
align-items: center;
padding: 0 5rem;
gap: $offshift-gap;
& &__left,
& &__right {
width: 16.25rem;
}
& &__left {
height: 1.875rem;
> img {
width: auto;
height: 100%;
display: block;
}
}
& &__center {
margin: 0 auto;
display: flex;
align-items: center;
align-self: flex-end;
gap: $offshift-gap * 2;
> a {
position: relative;
text-decoration: unset;
color: #1B0D3D;
text-transform: uppercase;
font-weight: 600;
font-size: 0.875rem;
padding-bottom: 1.25rem;
&.active:after {
width: 100%;
}
&:after {
width: 0;
left: 0;
bottom: 0;
position: absolute;
background: #5800B0;
height: 0.1875rem;
content: "";
transition: .5s ease-in-out;
}
}
}
& &__right {
display: flex;
align-items: center;
justify-content: flex-end;
gap: math.div($offshift-gap * 3, 2);;
}
& &__connect {
}
& &__switch {
position: relative;
cursor: pointer;
.light-mode,
.dark-mode {
position: absolute;
top: calc(50% - 0.5625rem);
font-size: 1rem;
z-index: 1;
color: #FFFFFF;
opacity: 0.3;
&.is-active {
opacity: unset;
color: #5800B0;
}
}
.light-mode {
left: 0.375rem;
}
.dark-mode {
right: 0.375rem;
}
> p-inputSwitch {
display: inline-flex;
}
}
}
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule,
],
declarations: [
AppComponent,
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
});
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { WalletService } from './core/services/wallet.service';
import { selectAccountAddress } from './core/selectors';
import { BaseComponent } from './base.component';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'
import { MenuItem } from 'primeng/api'
@Component({
selector: 'os-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent extends BaseComponent implements OnInit {
public accountAddress$: Observable<string>;
public isPhonePortrait = false;
public hideNavBar = false;
public menuItems: MenuItem[];
constructor(
store: Store,
private readonly _cdr: ChangeDetectorRef,
private readonly _walletService: WalletService,
private responsive: BreakpointObserver
) {
super(store);
this.accountAddress$ = this.store.select(selectAccountAddress);
}
ngOnInit(): void {
this.responsive.observe([
Breakpoints.HandsetPortrait
])
.subscribe(result => {
this.isPhonePortrait = false;
if (result.matches) {
this.isPhonePortrait = true;
this.hideNavBar = true;
}
})
this.menuItems = [
{
label: 'Shift',
routerLink: '/shift'
},
{
label: 'Vault',
routerLink: '/vault'
},
{
label: 'Token Swap',
routerLink: '/swap'
},
{
label: 'LP Staking',
routerLink: '/stake'
}
]
}
}
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { ButtonModule } from 'primeng/button';
import { DialogService, DynamicDialogModule } from 'primeng/dynamicdialog';
import { InputSwitchModule } from 'primeng/inputswitch';
import { MenubarModule } from 'primeng/menubar';
import { firstValueFrom } from 'rxjs';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ConnectWalletModule } from './components/connect-wallet/connect-wallet.module';
import { metaReducers, reducers } from './core';
import { CoreEffects } from './core/effects';
import { RouterParamsSerializer } from './core/router-params.serializer';
import { WalletService } from './core/services/wallet.service';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../environments/environment';
import { EffectsModule } from '@ngrx/effects';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
export function translateHttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
}
export function initializeFactory(
walletService: WalletService,
translateService: TranslateService,
): () => Promise<void> {
return () => {
return walletService.initialize()
.then(() => firstValueFrom(translateService.use('en')))
.then(() => {
const loader = document.querySelector('div.loader');
loader && document.body.removeChild(loader);
});
};
}
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserAnimationsModule,
BrowserModule,
HttpClientModule,
AppRoutingModule,
MenubarModule,
TranslateModule.forRoot({
defaultLanguage: 'en',
loader: {
provide: TranslateLoader,
useFactory: translateHttpLoaderFactory,
deps: [HttpClient],
},
isolate: true,
}),
DynamicDialogModule,
ButtonModule,
InputSwitchModule,
FormsModule,
StoreModule.forRoot(reducers, {
metaReducers,
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
},
}),
StoreDevtoolsModule.instrument({
maxAge: 25,
logOnly: environment.production,
}),
EffectsModule.forRoot([
CoreEffects,
]),
StoreRouterConnectingModule.forRoot({
stateKey: 'router',
}),
ConnectWalletModule,
],
bootstrap: [
AppComponent,
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: initializeFactory,
deps: [WalletService, TranslateService],
multi: true,
},
DialogService,
RouterParamsSerializer,
],
})
export class AppModule {
}
import { Store } from '@ngrx/store';
export abstract class BaseComponent {
protected constructor(
protected readonly store: Store,
) {
}
}
<div class="connect-wallet">
<div *ngIf="(accountAddress$ | ngrxPush) as accountAddress else connectWallet"
(click)="onDisconnectWalletClick()"
class="p-button connect-wallet__connected">
{{ accountAddress | shortAddress }}
</div>
<ng-template #connectWallet>
<button (click)="onConnectWalletClick()"
class="connect-wallet__connect"
pButton
type="button"
label="Connect wallet">
</button>
</ng-template>
</div>
@use "sass:math";
@import "~src/styles/variables";
:host {
display: inline-flex;
}
.connect-wallet {
display: inline-flex;
width: 100%;
& &__connect {
width: 100%;
}
& &__connected {
color: #1B0D3D;
border: 0.0625rem solid rgba(107, 57, 250, 0.1);
background: rgba(107, 57, 250, 0.1);
padding: 0.5rem 2rem;
height: 2.625rem;
}
}
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