Skip to content

Commit

Permalink
fix: make callbacks expandable by keyboard (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
stasiukanya authored Aug 20, 2020
1 parent 0ab06cf commit 46eee7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Callbacks/CallbackTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class CallbackTitle extends React.PureComponent<CallbackTitleProps> {
}
}

const CallbackTitleWrapper = styled.div`
const CallbackTitleWrapper = styled.button`
border: 0;
width: 100%;
text-align: left;
& > * {
vertical-align: middle;
}
Expand All @@ -45,7 +48,7 @@ const CallbackTitleWrapper = styled.div`
`;

const CallbackName = styled.span<{ deprecated?: boolean }>`
text-decoration: ${props => (props.deprecated ? 'line-through' : 'none')};
text-decoration: ${(props) => (props.deprecated ? 'line-through' : 'none')};
margin-right: 8px;
`;

Expand Down
2 changes: 2 additions & 0 deletions src/components/Callbacks/styled.elements.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from '../../styled-components';
import { CallbackTitle } from './CallbackTitle';
import { darken } from 'polished';

export const StyledCallbackTitle = styled(CallbackTitle)`
padding: 10px;
Expand All @@ -8,6 +9,7 @@ export const StyledCallbackTitle = styled(CallbackTitle)`
line-height: 1.5em;
background-color: ${({ theme }) => theme.colors.gray[100]};
cursor: pointer;
outline-color: ${({ theme }) => darken(theme.colors.tonalOffset, theme.colors.gray[100])};
`;

export const CallbackDetailsWrap = styled.div`
Expand Down

0 comments on commit 46eee7b

Please sign in to comment.