Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/neuron-ui/.storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
]
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
}
6 changes: 3 additions & 3 deletions packages/neuron-ui/.storybook/electron.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const sendSyncValues = {
'get-locale': 'zh',
'get-version': '0.103.1'
'get-version': '0.103.1',
}

module.exports = {
Expand All @@ -12,10 +12,10 @@ module.exports = {
return Promise.resolve({})
},
on() {},
removeAllListeners() {}
removeAllListeners() {},
},
clipboard() {},
nativeImage() {},
shell() {},
desktopCapturer() {}
desktopCapturer() {},
}
25 changes: 16 additions & 9 deletions packages/neuron-ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,38 @@ import { action } from '@storybook/addon-actions'
import { NeuronWalletContext, initStates } from '../src/states'

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
}
},
}

const dispatch = action('Dispatch')

BigInt.prototype['toJSON'] = function() { return this.toString() }
BigInt.prototype['toJSON'] = function () {
return this.toString()
}

export const decorators = [
(Story, { argTypes, args }) => {
const globalArgTypes = Object.keys(argTypes).filter(v => argTypes[v]?.isGlobal)
const globalStates = globalArgTypes.reduce((pre, cur) => args[cur] ? ({
...pre,
[cur]: args[cur]
}) : pre, initStates)
const globalStates = globalArgTypes.reduce(
(pre, cur) =>
args[cur]
? {
...pre,
[cur]: args[cur],
}
: pre,
initStates
)
return (
<NeuronWalletContext.Provider value={{ state: globalStates, dispatch }}>
<Story />
</NeuronWalletContext.Provider>
)
},
];

]
10 changes: 5 additions & 5 deletions packages/neuron-ui/public/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
@font-face {
font-family: 'ProximaNova-Regular';
src: url('../fonts/ProximaNova-Regular.otf') format('opentype'),
url('../fonts//Proximanova-Regular.ttf') format('opentype');
url('../fonts//Proximanova-Regular.ttf') format('opentype');
}

@font-face {
font-family: 'ProximaNova-Semibold';
src: url('../fonts/ProximaNova-Semibold.otf') format('opentype'),
url('../fonts/ProximaNova-Semibold.ttf') format('opentype');
url('../fonts/ProximaNova-Semibold.ttf') format('opentype');
}

@font-face {
font-family: 'D-DIN-PRO';
src: url('../fonts/D-DIN-PRO-500-Medium.otf') format('opentype'),
url('../fonts/D-DIN-PRO-500-Medium.ttf') format('opentype');
url('../fonts/D-DIN-PRO-500-Medium.ttf') format('opentype');
}

@font-face {
font-family: 'JetBrains Mono Medium';
src: url('../fonts/JetBrainsMonoNL-Medium.otf') format('opentype'),
url('../fonts/JetBrainsMonoNL-Medium.ttf') format('opentype');
url('../fonts/JetBrainsMonoNL-Medium.ttf') format('opentype');
}

@font-face {
font-family: 'JetBrains Mono';
src: url('../fonts/JetBrainsMonoNL-Regular.otf') format('opentype'),
url('../fonts/JetBrainsMonoNL-Regular.ttf') format('opentype');
url('../fonts/JetBrainsMonoNL-Regular.ttf') format('opentype');
}
32 changes: 15 additions & 17 deletions packages/neuron-ui/public/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="stylesheet" href="%PUBLIC_URL%/css/fonts.css" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<!--
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="stylesheet" href="%PUBLIC_URL%/css/fonts.css" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -16,14 +15,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Neuron</title>
</head>

<body>
<navbar class="navbar"></navbar>
<div id="notification" class="notification"></div>
<main id="root" class="main-content"></main>
<div id="dialog" class="dialog"></div>
</body>
<title>Neuron</title>
</head>

<body>
<navbar class="navbar"></navbar>
<div id="notification" class="notification"></div>
<main id="root" class="main-content"></main>
<div id="dialog" class="dialog"></div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
margin-left: 4px;

path {
fill: #FFFFFF;
fill: #ffffff;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ $textfieldWidth: calc(100vw - 370px);
}
}
}
.textFieldClass{
.textFieldClass {
margin-bottom: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ $line-gap: 15px;

.submission {
padding-top: 96px;

.title {
@include header-title;
margin-bottom: 16px;
}

.input {
width: 500px;
margin: 0 auto;
Expand Down Expand Up @@ -191,4 +191,4 @@ $line-gap: 15px;
margin-bottom: 24px;
animation: rotating 3s linear infinite;
}
}
}
3 changes: 1 addition & 2 deletions packages/neuron-ui/src/stories/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ body {
border: 2px solid #fff;
box-sizing: border-box;
background-color: lightslategrey;
background-image: linear-gradient(white 2px, transparent 2px),
linear-gradient(90deg, white 2px, transparent 2px),
background-image: linear-gradient(white 2px, transparent 2px), linear-gradient(90deg, white 2px, transparent 2px),
linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
Expand Down
74 changes: 37 additions & 37 deletions packages/neuron-ui/src/widgets/Calendar/calendar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
border: none;
background-color: transparent;
min-width: 0;
color: var(--main-text-color);
color: var(--main-text-color);
&[disabled] {
cursor: not-allowed;
color: var(--disable-button-text-color);
Expand Down Expand Up @@ -50,29 +50,29 @@
.calendarHeader {
display: flex;
justify-content: space-between;
align-items: center;
align-items: center;

.calPrev,
.calNext {
background: transparent;
border: none;
cursor: pointer;
svg {
g,
path {
stroke: var(--main-text-color)
}
}
background: transparent;
border: none;
cursor: pointer;
svg {
g,
path {
stroke: var(--main-text-color);
}
}
}
.calPrev {
order: 1;
&[disabled] {
svg {
g,
path {
stroke: var(--disable-button-text-color)
}
}
&[disabled] {
svg {
g,
path {
stroke: var(--disable-button-text-color);
}
}
}
}
.calNext {
Expand All @@ -84,29 +84,29 @@
margin: 0;
font-size: 16px;
line-height: 22px;
color: var(--main-text-color);
color: var(--main-text-color);
}
}

.calendarTable {
width: 100%;

thead {
position: relative;
tr {
height: 40px;
color: var(--main-text-color)
}
&::after {
position: absolute;
content: "";
background: var(--input-border-color);
left: 0;
bottom: -0;
height: 1px;
width: 100%;
}
}
thead {
position: relative;
tr {
height: 40px;
color: var(--main-text-color);
}
&::after {
position: absolute;
content: '';
background: var(--input-border-color);
left: 0;
bottom: -0;
height: 1px;
width: 100%;
}
}

td {
text-align: center;
Expand All @@ -115,8 +115,8 @@
button {
&:hover,
&:focus {
color: #fff;
background-color: var(--primary-color);
color: #fff;
background-color: var(--primary-color);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
& > span {
line-height: 1.625rem;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
font-size: 14px;
line-height: 24px;
background: var(--secondary-background-color);
color: var(--main-text-color)
color: var(--main-text-color);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
position: absolute;
right: 6px;
top: 14px;
width: 0
width: 0;
}
}

Expand Down
12 changes: 6 additions & 6 deletions packages/neuron-ui/src/widgets/MnemonicInput/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.root {
width: 624px;
background: var(--secondary-background-color);
border: 1px solid #F0F0F0;
border: 1px solid #f0f0f0;
border-radius: 8px;
display: grid;
grid-template-columns: repeat(6, 60px);
Expand All @@ -25,14 +25,14 @@

& .wordItem {
&:focus-within {
color: #00C891;
color: #00c891;
}
&:not(:focus-within) {
&.errorWords {
color: #FF1E1E;
color: #ff1e1e;
& > input {
border-bottom: 1px solid #FF1E1E;
color: #FF1E1E;
border-bottom: 1px solid #ff1e1e;
color: #ff1e1e;
}
}
}
Expand All @@ -56,7 +56,7 @@
padding-bottom: 4px;

&:focus {
border-bottom: 1px solid #00C891;;
border-bottom: 1px solid #00c891;
}
}
}
Expand Down
Loading