Skip to content

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
"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.

return <button {...props}>×</button>
}

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.


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

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

}};
${(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?

&: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
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