Skip to content

Commit

Permalink
Toolbar+ fixes (#4386)
Browse files Browse the repository at this point in the history
* better icon for stop play mode

* fix selected insert element style

* insert menu search color fixes

* insert menu item icon color on hover ifx
  • Loading branch information
lankaukk authored Oct 18, 2023
1 parent 09cbc1e commit 144fc5d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions editor/src/components/editor/canvas-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ export const CanvasToolbar = React.memo(() => {
<Tooltip title='Live Mode' placement='bottom'>
<InsertModeButton
testid={PlayModeButtonTestId}
iconType={isLiveMode ? 'icon-semantic-stop' : 'play'}
iconCategory={isLiveMode ? 'semantic' : 'tools'}
iconType={isLiveMode ? 'stop' : 'play'}
iconCategory='tools'
primary={canvasToolbarMode.primary === 'play'}
onClick={toggleLiveMode}
keepActiveInLiveMode
Expand Down Expand Up @@ -816,7 +816,7 @@ const InsertModeButton = React.memo((props: InsertModeButtonProps) => {
highlight
onClick={props.onClick}
disabled={canvasInLiveMode && !keepActiveInLiveMode}
overriddenBackground={secondary ? colorTheme.bg5.value : undefined}
overriddenBackground={secondary ? 'transparent' : undefined}
onMouseEnter={setIsHoveredTrue}
onMouseLeave={setIsHoveredFalse}
>
Expand All @@ -827,7 +827,11 @@ const InsertModeButton = React.memo((props: InsertModeButtonProps) => {
height={props.size ?? 18}
testId={props.testid == null ? undefined : `${props.testid}-icon`}
color={
isHovered && !props.primary ? 'dynamic' : props.primary ? 'on-highlight-main' : 'main'
(isHovered && !props.primary) || props.secondary
? 'dynamic'
: props.primary
? 'on-highlight-main'
: 'main'
}
/>
</SquareButton>
Expand Down
10 changes: 5 additions & 5 deletions editor/src/components/editor/insertmenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ const Option = React.memo((props: OptionProps<ComponentOptionItem, false>) => {
<Icn
category='element'
type='component'
color={isHovered ? 'primary' : isSelected ? 'on-light-main' : 'main'}
color={isHovered ? 'dynamic' : isSelected ? 'on-light-main' : 'main'}
width={18}
height={18}
style={{ transform: 'scale(0.8)' }}
Expand Down Expand Up @@ -406,8 +406,6 @@ function useSelectStyles(hasResults: boolean): StylesConfig<GroupOptionItem, fal
() => ({
container: (styles): CSSObject => ({
height: '100%',
paddingLeft: 8,
paddingRight: 8,
}),
control: (styles): CSSObject => ({
background: 'transparent',
Expand Down Expand Up @@ -445,6 +443,8 @@ function useSelectStyles(hasResults: boolean): StylesConfig<GroupOptionItem, fal
display: 'flex',
flexDirection: 'column',
gap: 2,
paddingLeft: 8,
paddingRight: 8,
}
},
input: (styles): CSSObject => {
Expand All @@ -454,7 +454,7 @@ function useSelectStyles(hasResults: boolean): StylesConfig<GroupOptionItem, fal
controlStyles: getControlStyles('simple'),
}) as CSSObject),
paddingLeft: 4,
backgroundColor: colorTheme.bg4.value,
backgroundColor: colorTheme.bg2.value,
flexGrow: 1,
display: 'flex',
alignItems: 'center',
Expand Down Expand Up @@ -639,7 +639,7 @@ const InsertMenuInner = React.memo((props: InsertMenuProps) => {
controlShouldRenderValue={false}
hideSelectedOptions={false}
menuIsOpen
placeholder='Filter…'
placeholder='Select…'
tabSelectsValue={false}
options={options}
onKeyDown={onKeyDown}
Expand Down

0 comments on commit 144fc5d

Please sign in to comment.