Skip to content

Commit 15915ff

Browse files
committed
Put disabled state back in navigation icons
1 parent 7acb6fc commit 15915ff

File tree

1 file changed

+18
-8
lines changed
  • packages/common/src/components/Preview/Navigator

1 file changed

+18
-8
lines changed

packages/common/src/components/Preview/Navigator/elements.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Icons = styled.div`
1818
display: flex;
1919
`;
2020

21-
export const Icon = styled.button<{ moduleView?: boolean }>`
21+
export const Icon = styled.button<{ moduleView?: boolean; disabled?: boolean }>`
2222
display: inline-block;
2323
border: none;
2424
background-color: transparent;
@@ -31,14 +31,24 @@ export const Icon = styled.button<{ moduleView?: boolean }>`
3131
outline: none;
3232
cursor: pointer;
3333
34-
${({ moduleView, theme }) =>
34+
svg path,
35+
svg rect {
36+
transition: 0.2s ease fill;
37+
}
38+
39+
${({ moduleView, disabled, theme }) =>
3540
!moduleView &&
36-
css`
37-
&:hover svg path,
38-
&:hover svg rect {
39-
fill: ${theme.light ? 'black' : 'white'};
40-
}
41-
`}
41+
(disabled
42+
? css`
43+
cursor: default;
44+
opacity: 0.6;
45+
`
46+
: css`
47+
&:hover svg path,
48+
&:hover svg rect {
49+
fill: ${theme.light ? 'black' : 'white'};
50+
}
51+
`)}
4252
4353
/* // TODO: Replace with new theme */
4454
${({ moduleView, theme }) =>

0 commit comments

Comments
 (0)