Skip to content

Commit 4bd8c4a

Browse files
Merge pull request #748 from iowillhoit/746-app-launcher-classname
allow className on app launcher modal
2 parents 50324a9 + b2cede6 commit 4bd8c4a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

components/app-launcher/index.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,21 @@ const AppLauncher = React.createClass({
8080
*/
8181
isOpen: PropTypes.bool,
8282
/**
83-
* Button that exists in the upper right hand corner of the App Launcher modal
83+
* CSS classes to be added to App Launcher Modal.
8484
*/
85-
modalHeaderButton: PropTypes.node,
85+
modalClassName: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
8686
/**
87-
* Callback when the App Launcher Modal is closed
87+
* Button that exists in the upper right hand corner of the App Launcher modal
8888
*/
89-
onClose: PropTypes.func,
89+
modalHeaderButton: PropTypes.node,
9090
/**
9191
* Allows longer application names without truncating them.
9292
*/
9393
noTruncate: PropTypes.bool,
94+
/**
95+
* Callback when the App Launcher Modal is closed
96+
*/
97+
onClose: PropTypes.func,
9498
/**
9599
* Search bar for the Modal's header. Will typically be an instance of `design-system-react/forms/input/search`
96100
*/
@@ -230,7 +234,7 @@ const AppLauncher = React.createClass({
230234
contentStyle={{ minHeight: modalContentStaticHeight }}
231235
isOpen={isOpen}
232236
onRequestClose={this.closeAppLauncher}
233-
containerClassName="app-launcher"
237+
containerClassName={classNames('app-launcher', this.props.modalClassName)}
234238
size="large"
235239
header={customModalHeader}
236240
headerClassName="slds-app-launcher__header"

components/forms/input/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const Input = React.createClass({
216216
// Using [object destructuring](https://facebook.github.io/react/docs/transferring-props.html#transferring-with-...-in-jsx) to pass on any properties which are not explicitly defined.
217217
...props
218218
} = this.props;
219-
219+
220220
const labelText = label || assistiveText; // One of these is required to pass accessibility tests
221221

222222
// this is a hack to make left the default prop unless overwritten by `iconPosition="right"`

stories/app-launcher/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ const DemoAppLauncher = React.createClass({
273273
<AppLauncher
274274
triggerName="App Name"
275275
search={search}
276+
modalClassName="custom-modal-class"
276277
modalHeaderButton={modalHeaderButton}
277278
isOpen={this.state.appLauncherOpen}
278279
triggerOnClick={this.toggleAppLauncher}

tests/app-launcher/app-launcher.test.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ describe('SLDS APP LAUNCHER *******************************************', () =>
8080
onClose = sinon.spy();
8181

8282
mountAppLauncher({
83+
modalClassName: 'custom-modal-class',
8384
modalHeaderButton: <Button label="App Exchange" />,
8485
onClose,
8586
search: <Search assistiveText="Find an app" />,
@@ -95,6 +96,10 @@ describe('SLDS APP LAUNCHER *******************************************', () =>
9596
should.exist(handles.modal);
9697
});
9798

99+
it('renders custom modal class', () => {
100+
should.exist(handles.modal.find('.custom-modal-class'));
101+
});
102+
98103
it('renders modal header', () => {
99104
should.exist(handles.modal.find('.slds-app-launcher__header'));
100105
});

0 commit comments

Comments
 (0)