-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(popups): Add @mentions UI (#470)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
cafd44d
commit db7033d
Showing
12 changed files
with
547 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@import '~box-ui-elements/es/styles/variables'; | ||
|
||
.ba-PopupList { | ||
font-size: 13px; | ||
|
||
.ba-Popup-arrow { | ||
display: none; | ||
} | ||
|
||
.ba-Popup-content { | ||
padding-top: 10px; | ||
border: solid 1px $bdl-gray-30; | ||
border-radius: $bdl-border-radius-size; | ||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05); | ||
} | ||
|
||
.ba-PopupList-item { | ||
padding: 10px; | ||
} | ||
|
||
.ba-PopupList-prompt { | ||
padding-top: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import messages from '../messages'; | ||
import PopupBase from '../PopupBase'; | ||
import { Options, PopupReference } from '../Popper'; | ||
|
||
import './PopupList.scss'; | ||
|
||
export type Props = { | ||
reference: PopupReference; | ||
}; | ||
|
||
const options: Partial<Options> = { | ||
modifiers: [ | ||
{ | ||
name: 'offset', | ||
options: { | ||
offset: [0, 3], | ||
}, | ||
}, | ||
{ | ||
name: 'eventListeners', | ||
options: { | ||
scroll: false, | ||
}, | ||
}, | ||
], | ||
placement: 'bottom-start', | ||
}; | ||
|
||
const PopupList = ({ reference, ...rest }: Props): JSX.Element => ( | ||
<PopupBase className="ba-PopupList" options={options} reference={reference} {...rest}> | ||
<div className="ba-PopupList-prompt ba-PopupList-item"> | ||
<FormattedMessage {...messages.popupListPrompt} /> | ||
</div> | ||
</PopupBase> | ||
); | ||
|
||
export default PopupList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/components/Popups/ReplyField/__tests__/PopupList-test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
import PopupBase from '../../PopupBase'; | ||
import PopupList, { Props } from '../PopupList'; | ||
|
||
describe('components/Popups/ReplyField/PopupList', () => { | ||
const defaults: Props = { | ||
reference: document.createElement('div'), | ||
}; | ||
|
||
const getWrapper = (props = {}): ShallowWrapper => shallow(<PopupList {...defaults} {...props} />); | ||
|
||
describe('render()', () => { | ||
test('should render popupBase with correct props', () => { | ||
const wrapper = getWrapper(); | ||
|
||
expect(wrapper.find(PopupBase).props()).toMatchObject({ | ||
className: 'ba-PopupList', | ||
reference: defaults.reference, | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.