Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement add to bookmark page - Closes #2056 #2192

Merged
merged 27 commits into from Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c21a963
:seedling: Add addBookmark route and component
massao Jun 26, 2019
de8bfbd
:recycle: Update generated strings
massao Jun 26, 2019
66ba708
:recycle: Finish initial logic of add new bookmark
massao Jun 26, 2019
4af70c2
:recycle: Refactor add new bookmark component
massao Jun 26, 2019
13d2f4d
:recycle: Add placeholder prop to accountVisual
massao Jun 27, 2019
1dc4d6d
:recycle: Adjust input toolbox component to have error prop in favor …
massao Jun 27, 2019
c122e90
:recycle: Add avatar to field and improve revalidation logic when upd…
massao Jun 27, 2019
2d8650d
:recycle: Update generated strings
massao Jun 27, 2019
ef2f200
:recycle: Add autocomplete=off to inputs on add Bookmark
massao Jun 27, 2019
0aeb87f
:fire: Remove unused component
massao Jun 27, 2019
d7477a6
:white_check_mark: Adjust inputV2 unit tests
massao Jun 27, 2019
ef9d235
:recycle: Fix issue when adding BTC account
massao Jun 27, 2019
5403939
:white_check_mark: Add unit test for AddBookmark component
massao Jun 27, 2019
6cf2845
Merge branch 'development' into 2056-implement-add-to-bookmark
massao Jun 28, 2019
12cbab2
:nail_care: Update button to use variable for width
massao Jun 28, 2019
95795b4
:recycle: Removed curly braces from jsx where possible
massao Jun 28, 2019
26c2b38
:recycle: Change token change behaviour to clear inputs
massao Jun 28, 2019
d3d139e
:nail_care: Fix issue with dropdown on dark mode
massao Jun 28, 2019
190afb6
:recycle: Adjust feedback component to not use global class
massao Jun 28, 2019
f8accaf
:recycle: Remove default props from input so it not show wrongly in o…
massao Jun 28, 2019
8f6d17d
:recycle: Adjust how feedback component is used on add bookmark
massao Jun 28, 2019
b7799c3
:nail_care: Adjust css to use variables and fix spacings
massao Jun 28, 2019
8237b5e
Revert ":fire: Remove unused component"
massao Jun 28, 2019
320a072
:white_check_mark: Adjust unit test of add bookmark
massao Jun 28, 2019
1bf70ff
:recycle: Temporary redirect to dashboard
massao Jun 28, 2019
8c3af0f
Merge branch 'development' into 2056-implement-add-to-bookmark
massao Jun 28, 2019
9710a1b
:bug: Fix issue when changing address after using a delegate one
massao Jun 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions i18n/locales/en/common.json
Expand Up @@ -29,6 +29,7 @@
"Add a Lisk ID to follow": "Add a Lisk ID to follow",
"Add a bookmark": "Add a bookmark",
"Add address to bookmarks": "Add address to bookmarks",
"Add bookmark": "Add bookmark",
"Add some {{activeToken}} to your Lisk Hub account now!": "Add some {{activeToken}} to your Lisk Hub account now!",
"Add to bookmarks": "Add to bookmarks",
"Add to list": "Add to list",
Expand Down Expand Up @@ -227,6 +228,8 @@
"Incoming transactions": "Incoming transactions",
"Info": "Info",
"Initialize Lisk ID": "Initialize Lisk ID",
"Insert label": "Insert label",
"Insert public address": "Insert public address",
"Insert public address or a name": "Insert public address or a name",
"Insert the amount of transaction": "Insert the amount of transaction",
"Install update": "Install update",
Expand All @@ -247,6 +250,8 @@
"LSK": "LSK",
"LSK forged": "LSK forged",
"LSK received": "LSK received",
"Label": "Label",
"Label is too long.": "Label is too long.",
"Last Forged Block": "Last Forged Block",
"Later": "Later",
"Learn about blockchain with our comprehensive knowledge base.": "Learn about blockchain with our comprehensive knowledge base.",
Expand Down Expand Up @@ -285,6 +290,7 @@
"Max": "Max",
"Max amount must be greater than Min amount": "Max amount must be greater than Min amount",
"Max amount of delegates in one voting exceeded.": "Max amount of delegates in one voting exceeded.",
"Max. 20 characters": "Max. 20 characters",
"Max. 20 characters, a-z, 0-1, no special characters except !@$_.": "Max. 20 characters, a-z, 0-1, no special characters except !@$_.",
"Maximum floating point is 8.": "Maximum floating point is 8.",
"Maximum length exceeded": "Maximum length exceeded",
Expand All @@ -298,6 +304,7 @@
"My votes after confirmation": "My votes after confirmation",
"Name is already taken!": "Name is already taken!",
"Network switcher": "Network switcher",
"New bookmark": "New bookmark",
"New to Lisk? ": "New to Lisk? ",
"Next": "Next",
"Nickname is too long.": "Nickname is too long.",
Expand Down
8 changes: 8 additions & 0 deletions src/components/accountVisual/accountVisual.css
@@ -1,3 +1,5 @@
@import '../app/variablesV2.css';

.wrapper {
display: inline-block;
border-radius: 100%;
Expand All @@ -9,3 +11,9 @@
overflow: hidden;
display: inline-block;
}

.placeholder {
background-color: var(--color-platinum);
border-radius: 50%;
display: inline-block;
}
14 changes: 12 additions & 2 deletions src/components/accountVisual/index.js
Expand Up @@ -181,7 +181,8 @@ class AccountVisual extends React.Component {

shouldComponentUpdate(nextProps, state) {
return this.state.isSBreakpoint !== state.isSBreakpoint
|| nextProps.address !== this.props.address;
|| nextProps.address !== this.props.address
|| nextProps.placeholder !== this.props.placeholder;
}

resizeWindow() {
Expand All @@ -202,12 +203,21 @@ class AccountVisual extends React.Component {

render() { // eslint-disable-line max-statements
const {
address, size, sizeS, className,
address, size, sizeS, className, placeholder,
} = this.props;

const sizeL = size || 200;
const newSize = this.state.isSBreakpoint && sizeS ? sizeS : sizeL;

if (placeholder) {
return (
<span
className={`${styles.placeholder} ${className}`}
style={{ height: newSize, width: newSize }}
/>
);
}

if (!reg.address.test(address)) {
return <img
src={svg.btcIcon}
Expand Down
1 change: 1 addition & 0 deletions src/components/app/variablesV2.css
Expand Up @@ -73,6 +73,7 @@ or "warn/action" ineastd of "red/green"
--header-logo-size: 56px;
--search-box-width-l: 597px;
--footer-button-width: 400px;
--medium-box-width: 720px;

/*************************
Padding
Expand Down
86 changes: 86 additions & 0 deletions src/components/bookmarks/addBookmark/addBookmark.css
@@ -0,0 +1,86 @@
@import '../../app/variablesV2.css';
@import '../../app/mixins.css';

.wrapper {
display: flex;
justify-content: center;
width: 100%;

& .content {
width: var(--medium-box-width);

& header {
display: flex;
justify-content: space-between;
align-items: center;
}

& h1 {
@mixin headingLarge;
}
}
}

.formHolder {
display: flex;
flex-direction: column;
padding: 20px;

& > .buttonHolder {
display: flex;
margin: 0 auto 30px;
width: var(--footer-button-width);

& button {
display: block;
width: 100%;
}
}

& .fieldGroup {
display: block;
position: relative;

& .avatar {
left: 16px;
position: absolute;
top: 12px;
}
}

& label {
display: block;
margin-bottom: 12px;

& > .label {
@mixin contentNormal bold;

color: var(--color-maastricht-blue);
display: block;
margin-bottom: 12px;
}

& .input[name="address"] {
padding-left: 48px;
}

& .input:focus ~ .feedback {
opacity: 1 !important;
}
}

& .feedback {
slaweet marked this conversation as resolved.
Show resolved Hide resolved
margin-top: 5px;
min-height: 40px;
opacity: 0;

&.error {
opacity: 1;
}

&:not(.error) {
padding-left: 0;
padding-right: 0;
}
}
}