signal-desktop/ts/components/_util.ts

17 lines
436 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2019 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
2019-11-19 23:03:00 +00: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-09 00:53:06 +00:00
export function getNavSidebarWidthBreakpoint(width: number): WidthBreakpoint {
return width >= 150 ? WidthBreakpoint.Wide : WidthBreakpoint.Narrow;
}