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

Frame header #1159

Merged
merged 9 commits into from
Aug 17, 2020
Merged

Frame header #1159

merged 9 commits into from
Aug 17, 2020

Conversation

OskarDamkjaer
Copy link
Contributor

@OskarDamkjaer OskarDamkjaer commented Aug 12, 2020

Adds UI controls to the editor. Details in the comments

Gif demo of new looks gif

changelog: Make editor a frame that has control buttons

@OskarDamkjaer OskarDamkjaer changed the title Frame header [wip] Frame header Aug 12, 2020
@OskarDamkjaer OskarDamkjaer changed the title [wip] Frame header Frame header Aug 13, 2020
@@ -47,7 +47,9 @@
"prettier/@typescript-eslint"
],
"plugins": ["@typescript-eslint/eslint-plugin"],
"rules": {}
"rules": {
"@typescript-eslint/explicit-function-return-type": "off"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up for discussion if we want to keep this, I liked not needing to write return type on components mostly.

@@ -33,11 +33,16 @@ export const CloseButton = props => {
}

export const EditorButton = props => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the editorbuttons flexible in size

export { withBus, BusProvider, BusProps }
}

declare module 'suber' {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a start for typing up suber and react-suber. Some of the anys are unavoidable sadly. Perhaps we could do something with generics but not sure if it's worth it.

@@ -33,8 +34,8 @@ interface ActionButton {
iconColor?: string
}

const ActionButtons: React.FC<ActionButtonProps> = ({ buttons }) => (
<ActionButtonSection containerWidth={buttons.length * 33}>
const ActionButtons = ({ buttons, width = 24 }: ActionButtonProps) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved away from React.FC after reading this: facebook/create-react-app#8177

@@ -80,7 +80,6 @@ export class Editor extends Component {
buffer: '',
mode: 'cypher',
notifications: [],
expanded: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full screen state lifted to new component

message: message
.split('\n')
.filter((nonEmpty: string) => nonEmpty)
.join(' '),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behaviour! Like we talked about it makes no sense to show a collapse-button if you can't use it. To me it felt natural to join the lines together.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with ABK if this is OK

}
return "'editor header'"
}};
grid-template-areas: 'editor header';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could perhaps be simpler with flexbox. I think it's good enough

// 230 is 10 lines + 2*12px padding
return '254px'
}
return '0'
}};

${(props): string => (props.expanded ? '' : 'transition-duration: 0.1s;')}
transition-duration: 0.1s;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked buggy before when changing color on card view, the check is not needed anymore

background-color: ${props => props.theme.secondaryBackground};
margin: ${editorPadding}px 0px ${editorPadding}px 0;
border-radius: 2px;
box-shadow: 0px 0px 2px rgba(52, 58, 67, 0.1),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it looked too flat, got this box-shadow from liza. Thoughts?

@@ -50,6 +49,9 @@ export const StyledFrame = styled.article`
&:hover .carousel-intro-animation {
opacity: 0;
}
box-shadow: 0px 0px 2px rgba(52, 58, 67, 0.1),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "standardized" box shadow from designsystem

@OskarDamkjaer OskarDamkjaer requested a review from HerrEmil August 13, 2020 10:51
@OskarDamkjaer OskarDamkjaer marked this pull request as ready for review August 13, 2020 10:51
package.json Outdated Show resolved Hide resolved
message: message
.split('\n')
.filter((nonEmpty: string) => nonEmpty)
.join(' '),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with ABK if this is OK

@OskarDamkjaer OskarDamkjaer merged commit 6e1e21c into neo4j:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants