signal-desktop/ts/components/_util.ts

17 lines
436 B
TypeScript
Raw Normal View History

2023-01-03 11:55:46 -08:00
// Copyright 2019 Signal Messenger, LLC
2020-10-30 15:34:04 -05:00
// SPDX-License-Identifier: AGPL-3.0-only
2019-11-19 15:03:00 -08:00
export function cleanId(id: string): string {
return id.replace(/[^\u0020-\u007e\u00a0-\u00ff]/g, '_');
}
export enum WidthBreakpoint {
Wide = 'wide',
Medium = 'medium',
Narrow = 'narrow',
}
2023-08-08 17:53:06 -07:00
export function getNavSidebarWidthBreakpoint(width: number): WidthBreakpoint {
return width >= 150 ? WidthBreakpoint.Wide : WidthBreakpoint.Narrow;
}