mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 10:58:19 +01:00
One SearchInput to rule them all
This commit is contained in:
17
ts/util/getClassNamesFor.ts
Normal file
17
ts/util/getClassNamesFor.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
export function getClassNamesFor(
|
||||
...modules: Array<string | undefined>
|
||||
): (modifier?: string) => string {
|
||||
return modifier => {
|
||||
const cx = modules.map(parentModule =>
|
||||
parentModule && modifier !== undefined
|
||||
? `${parentModule}${modifier}`
|
||||
: undefined
|
||||
);
|
||||
return classNames(cx);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user