-
Notifications
You must be signed in to change notification settings - Fork 224
Conversation
f230067
to
d24b2b7
Compare
<ViewSwitch | ||
fontSize={Size.M} | ||
justify="center" | ||
leftVisible={!!previousPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using Boolean(previousPage)
would be a bit nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
fontSize?: Size; | ||
justify?: 'start' | 'center' | 'end' | 'stretch'; | ||
leftVisible: boolean; | ||
onLeftClick: React.MouseEventHandler<SVGElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please name all event handler handle...
. This way they are a lot easier to differentiate from the native react event handlers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've so far understood is that the convention is:
-
onClick: for defining props names. For the elements just receiving the props or passing them. So
on
is describing the actual event this will be tied to. -
handleClick: for the component that is actually operating or acting on the click event. is
handle
describing what will be called when that event fires.
What is your opinion about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we only use on
when we use a pass something to a native react event prop.
This has the benefit that you can immediately see which event handlers are custom ones and could have a different response than you would assume.
justify="center" | ||
leftVisible={!!previousPage} | ||
rightVisible={!!nextPage} | ||
onLeftClick={() => (previousPage ? store.openPage(previousPage.getId()) : undefined)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onLeftClick
is not optional. It should not be valid to pass undefined as a value here.
Maybe just always pass the function. I will not be triggered because the buttons are not visible if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
|
||
export interface ViewSwitchProps { | ||
fontSize?: Size; | ||
justify?: 'start' | 'center' | 'end' | 'stretch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not very nice. You are just moving every css possibility in to the props.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that is right. When more items come in chrome we will be going to need them :).
Would you like me to reduce them to the current necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now we should reduce them :)
@@ -1,8 +1,11 @@ | |||
import Chrome from '../../lsg/patterns/chrome'; | |||
import { Size } from '../../lsg/patterns/copy'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Size } from '../../lsg/patterns/copy';
=> import { Size as FontSize } from '../../lsg/patterns/copy';
With that it is more clear which size is meant. In the copy component it's kind of obvious but not here in the chrome-container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
<OverviewSwitchContainer /> | ||
<ViewSwitch | ||
fontSize={Size.M} | ||
justify="center" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please create a type for justify
in src/lsg/patterns/view-switch/index.tsx
and export it so it can be used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
<ViewSwitch | ||
fontSize={Size.M} | ||
justify="center" | ||
leftVisible={!!previousPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refactror this too to use !!
but Boolean()
. The !!
is pretty easy to oversee but Boolean()
is easy to see. Afaik that is also something that was agreed on for this project. Correct me if I'm wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
fontSize={Size.M} | ||
justify="center" | ||
leftVisible={!!previousPage} | ||
rightVisible={!!nextPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refactror this too to use !!
but Boolean()
. The !!
is pretty easy to oversee but Boolean()
is easy to see. Afaik that is also something that was agreed on for this project. Correct me if I'm wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
@@ -0,0 +1,32 @@ | |||
// import * as MobX from 'mobx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't need this one please delete the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, my bad. Done too :)
return ( | ||
<ViewSwitch | ||
onLeftClick={() => store.togglePageOverview()} | ||
onRightClick={() => null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't need that function always, please consider to make it optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
src/lsg/patterns/chrome/demo.tsx
Outdated
@@ -0,0 +1,30 @@ | |||
import { Size } from '../copy'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Size } from '../../lsg/patterns/copy';
=> import { Size as FontSize } from '../../lsg/patterns/copy';
With that it is more clear which size is meant. In the copy component it's kind of obvious but not here in the chrome-container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
} | ||
|
||
const StyledViewSwitch = styled.div` | ||
display: inline-flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't have to be inline-flex
, flex
only is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually in this case you're right. ✅
src/lsg/patterns/icons/index.tsx
Outdated
@@ -41,6 +42,7 @@ const icons: { readonly [key: string]: JSX.Element[][] | JSX.Element[] } = { | |||
[<path key="arrow" d="M17.5 12l-8.486 8.485L7.6 19.071 14.671 12 7.6 4.929l1.414-1.414z" />] | |||
], | |||
[IconName.ArrowFill]: [[<path key="arrowFill" d="M8 4l8 8-8 8z" />]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refactor this one the ArrowFillRight
with that it will be easier to use the correct one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -0,0 +1,80 @@ | |||
import { colors } from '../colors'; | |||
import { Size } from '../copy'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Size } from '../../lsg/patterns/copy';
=> import { Size as FontSize } from '../../lsg/patterns/copy';
With that it is more clear which size is meant. In the copy component it's kind of obvious but not here in the chrome-container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
When I tried the feature the first thing I tried was to click on |
@Palmaswell Out of design perspective: Looks good to me – I only came across two thingies:
|
@tilmx I talkt with @Palmaswell yesterday about the hiding of the page switch on the page overview. Whats your opinion on that suggestion? |
0819e12
to
2d16109
Compare
@Jumace , @markusoelhafen , @tilmx Regarding @Jumace comment regarding the clickable label. I think he is right, but if we decide to do so please make a new ticket for this feature. This is a behavior that is already in |
@tilmx Regarding your comment.
|
Hey @Palmaswell, @Jumace and @lkuechler Overview Link Double Click on Page Name Page Switch in Chrome <3 |
@tilmx Page Switch in Chrome: |
Hey @Palmaswell! What’s the status here? Can we finish this PR this week? |
Hi @tilmx, I am on holidays until Monday. I guess it must wait until then. |
9ae3a6c
to
7edd498
Compare
Addressed
Addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Love it! <3
❤️ @Palmaswell * feat: add page overview * chore: update lock file * fix: update usage of arrow icons * fix: be consistent about event listener names * fix: consistently indicate texts can be edited * fix: truncate too long page titles * fix: adjust project title styling and page inset * fix: visually align chrome title * fix: adapt styling of view-switch * fix: ensure page list title clicks enable edit mode * feat: show view button only page detail view * fix: visually align chrome title * feat: wrap the page list for narrow viewports * fix: manage preview resizing lifecycle correctly
fix: avoid jumping heights via text-overflow: ellipsis feat: page overview (#399) :heart: @Palmaswell * feat: add page overview * chore: update lock file * fix: update usage of arrow icons * fix: be consistent about event listener names * fix: consistently indicate texts can be edited * fix: truncate too long page titles * fix: adjust project title styling and page inset * fix: visually align chrome title * fix: adapt styling of view-switch * fix: ensure page list title clicks enable edit mode * feat: show view button only page detail view * fix: visually align chrome title * feat: wrap the page list for narrow viewports * fix: manage preview resizing lifecycle correctly feat: add floating-button component (#425) * feat: add floating-button component * fix: add plus icon to icon library feat: allow users to add new pages (#426) fix(highlight): include blur behaviour feat(preview-renderer): Rebase master status
Page Switch implementation