mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-09-08 02:50:38 +00:00
Redsign qortal-ui repo
This commit is contained in:
7
core/config/config.js
Normal file
7
core/config/config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const coin = require('./default.coin.config.js')
|
||||
const crypto = require('./default.crypto.config.js')
|
||||
const user = require('./default.user.config.js')
|
||||
const styles = require('./default.styles.config.js')
|
||||
const build = require('./default.build.options.js')
|
||||
|
||||
module.exports = { coin, crypto, user, styles, build }
|
135
core/config/default.build.options.js
Normal file
135
core/config/default.build.options.js
Normal file
@@ -0,0 +1,135 @@
|
||||
const path = require('path')
|
||||
|
||||
const { makeSourceAbsolute } = require('../tooling/utils.js')
|
||||
const srcDir = '../src'
|
||||
|
||||
const options = {
|
||||
inputFile: path.join(__dirname, '../src/main.js'),
|
||||
outputDir: path.join(__dirname, '../build'),
|
||||
sassOutputDir: path.join(__dirname, '../build/styles.bundle.css'),
|
||||
imgDir: path.join(__dirname, '../img')
|
||||
}
|
||||
|
||||
const aliases = {
|
||||
'qortal-ui-crypto': 'node_modules/qortal-ui-crypto/api.js'
|
||||
}
|
||||
|
||||
const apiComponents = {
|
||||
api: {
|
||||
file: 'api/api.js',
|
||||
className: 'api'
|
||||
}
|
||||
}
|
||||
|
||||
const functionalComponents = {
|
||||
'loading-ripple': {
|
||||
file: 'functional-components/loading-ripple.js',
|
||||
className: 'LoadingRipple'
|
||||
},
|
||||
'confirm-transaction-dialog': {
|
||||
file: 'functional-components/confirm-transaction-dialog',
|
||||
className: 'ConfirmTransactionDialog'
|
||||
}
|
||||
}
|
||||
|
||||
const inlineComponents = [
|
||||
{
|
||||
className: 'worker',
|
||||
input: path.join(__dirname, srcDir, 'worker.js'),
|
||||
output: 'worker.js'
|
||||
},
|
||||
{
|
||||
className: 'PluginMainJSLoader',
|
||||
input: path.join(__dirname, srcDir, '/plugins/plugin-mainjs-loader.js'),
|
||||
output: 'plugins/plugin-mainjs-loader.js'
|
||||
}
|
||||
]
|
||||
|
||||
const elementComponents = {
|
||||
'main-app': {
|
||||
file: 'components/main-app.js',
|
||||
className: 'MainApp',
|
||||
children: {
|
||||
'app-styles': {
|
||||
file: 'styles/app-styles.js',
|
||||
className: 'AppStyles',
|
||||
children: {
|
||||
'app-theme': {
|
||||
className: 'AppTheme',
|
||||
file: 'styles/app-theme.js'
|
||||
}
|
||||
}
|
||||
},
|
||||
'app-view': {
|
||||
file: 'components/app-view.js',
|
||||
className: 'AppView',
|
||||
children: {
|
||||
'show-plugin': {
|
||||
file: 'components/show-plugin.js',
|
||||
className: 'ShowPlugin'
|
||||
},
|
||||
'wallet-profile': {
|
||||
file: 'components/wallet-profile.js',
|
||||
className: 'WalletProfile'
|
||||
},
|
||||
'app-info': {
|
||||
file: 'components/app-info.js',
|
||||
className: 'AppInfo'
|
||||
}
|
||||
}
|
||||
},
|
||||
'login-view': {
|
||||
file: 'components/login-view/login-view.js',
|
||||
className: 'LoginView',
|
||||
children: {
|
||||
'create-account-section': {
|
||||
file: 'components/login-view/create-account-section.js',
|
||||
className: 'CreateAccountSection'
|
||||
},
|
||||
'login-section': {
|
||||
file: 'components/login-view/login-section.js',
|
||||
className: 'LoginSection'
|
||||
}
|
||||
}
|
||||
},
|
||||
'settings-view': {
|
||||
file: 'components/settings-view/user-settings.js',
|
||||
className: 'UserSettings',
|
||||
children: {
|
||||
'account-view': {
|
||||
file: 'components/settings-view/account-view.js',
|
||||
className: 'AccountView'
|
||||
},
|
||||
'security-view': {
|
||||
file: 'components/settings-view/security-view.js',
|
||||
className: 'SecurityView'
|
||||
},
|
||||
'qr-login-view': {
|
||||
file: 'components/settings-view/qr-login-view.js',
|
||||
className: 'QRLoginView'
|
||||
},
|
||||
'notifications-view': {
|
||||
file: 'components/settings-view/notifications-view.js',
|
||||
className: 'NotificationsView'
|
||||
}
|
||||
}
|
||||
},
|
||||
'user-info-view': {
|
||||
file: 'components/user-info-view/user-info-view.js',
|
||||
className: 'UserInfoView'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
makeSourceAbsolute(path.join(__dirname, srcDir), elementComponents)
|
||||
makeSourceAbsolute(path.join(__dirname, srcDir), functionalComponents)
|
||||
|
||||
module.exports = {
|
||||
options,
|
||||
elementComponents,
|
||||
functionalComponents,
|
||||
inlineComponents,
|
||||
apiComponents,
|
||||
aliases
|
||||
}
|
11
core/config/default.coin.config.js
Normal file
11
core/config/default.coin.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const coin = {
|
||||
name: 'Qortal',
|
||||
symbol: 'QORT',
|
||||
addressCount: 1,
|
||||
addressVersion: 58,
|
||||
decimals: 100000000,
|
||||
logo: '/img/QORT_LOGO.png',
|
||||
icon: '/img/QORT_LOGO.png'
|
||||
}
|
||||
|
||||
module.exports = coin
|
11
core/config/default.crypto.config.js
Normal file
11
core/config/default.crypto.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const crypto = {
|
||||
kdfThreads: 16,
|
||||
staticSalt: '4ghkVQExoneGqZqHTMMhhFfxXsVg2A75QeS1HCM5KAih', // Base58 encoded
|
||||
bcryptRounds: 11, // Note it's kinda bcryptRounds * log.2.16, cause it runs on all 16 threads
|
||||
bcryptVersion: '2a',
|
||||
get staticBcryptSalt () {
|
||||
return `$${this.bcryptVersion}$${this.bcryptRounds}$IxVE941tXVUD4cW0TNVm.O`
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = crypto
|
40
core/config/default.styles.config.js
Normal file
40
core/config/default.styles.config.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const styles = {
|
||||
breakpoints: {
|
||||
desktop: '',
|
||||
laptop: '',
|
||||
tablet: '',
|
||||
mobile: ''
|
||||
},
|
||||
theme: {
|
||||
colors: {
|
||||
primary: '#03a9f4', /* Sets the text color to the theme primary color. */
|
||||
primaryBg: '#e8eaf6', /* Sets the background color to the theme primary color. */
|
||||
onPrimary: '#fff', /* Sets the text color to the color configured for text on the primary color. */
|
||||
|
||||
secondary: '#03a9f4', /* Sets the text color to the theme secondary color. */
|
||||
secondaryBg: '#fce4ec', /* Sets the background color to the theme secondary color. */
|
||||
onSecondary: '#fff', /* Sets the text color to the color configured for text on the secondary color. */
|
||||
|
||||
surface: '#fff', /* Sets the background color to the surface background color. */
|
||||
onSurface: '#333', /* Sets the text color to the color configured for text on the surface color. */
|
||||
background: '#eee', /* Sets the background color to the theme background color. */
|
||||
|
||||
warning: '#FFA000',
|
||||
error: '#F44336'
|
||||
},
|
||||
|
||||
addressColors: [
|
||||
'#256480',
|
||||
'#002530',
|
||||
'#02564e',
|
||||
'#d32f2f',
|
||||
'#795548',
|
||||
'#004d40',
|
||||
'#006064',
|
||||
'#9c27b0',
|
||||
'#2196f3',
|
||||
'#d81b60'
|
||||
]
|
||||
}
|
||||
}
|
||||
module.exports = styles
|
46
core/config/default.user.config.js
Normal file
46
core/config/default.user.config.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const path = require('path')
|
||||
|
||||
const user = {
|
||||
node: 0,
|
||||
nodeSettings: {
|
||||
pingInterval: 30 * 1000,
|
||||
},
|
||||
server: {
|
||||
writeHosts: {
|
||||
enabled: true,
|
||||
},
|
||||
relativeTo: path.join(__dirname, '../'),
|
||||
primary: {
|
||||
domain: '0.0.0.0',
|
||||
address: '0.0.0.0',
|
||||
port: 12388,
|
||||
directory: './src/',
|
||||
page404: './src/404.html',
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
},
|
||||
tls: {
|
||||
enabled: false,
|
||||
options: {
|
||||
key: '',
|
||||
cert: '',
|
||||
},
|
||||
},
|
||||
constants: {
|
||||
pollingInterval: 30 * 1000, // How long between checking for new unconfirmed transactions and new blocks (in milliseconds).
|
||||
workerURL: '/build/worker.js',
|
||||
},
|
||||
|
||||
// Notification Settings (All defaults to true)
|
||||
notifications: {
|
||||
q_chat: {
|
||||
playSound: true,
|
||||
showNotification: true,
|
||||
},
|
||||
block: {
|
||||
playSound: true,
|
||||
showNotification: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
module.exports = user
|
21
core/config/load-config.js
Normal file
21
core/config/load-config.js
Normal file
@@ -0,0 +1,21 @@
|
||||
let config = require('./config.js')
|
||||
|
||||
const checkKeys = (storeObj, newObj) => {
|
||||
for (const key in newObj) {
|
||||
if (!Object.prototype.hasOwnProperty.call(storeObj, key)) return
|
||||
|
||||
if (typeof newObj[key] === 'object') {
|
||||
storeObj[key] = checkKeys(storeObj[key], newObj[key])
|
||||
} else {
|
||||
storeObj[key] = newObj[key]
|
||||
}
|
||||
}
|
||||
return storeObj
|
||||
}
|
||||
|
||||
const getConfig = customConfig => {
|
||||
config = checkKeys(config, customConfig)
|
||||
return config
|
||||
}
|
||||
|
||||
module.exports = getConfig
|
Reference in New Issue
Block a user