Add overflow to SDS Message
This commit is contained in:
@@ -52,9 +52,11 @@ export const SettingsBtn = () => {
|
||||
}, [user, setMic]);
|
||||
|
||||
useEffect(() => {
|
||||
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
||||
setInputDevices(devices.filter((d) => d.kind === "audioinput"));
|
||||
});
|
||||
if (typeof navigator !== "undefined" && navigator.mediaDevices?.enumerateDevices) {
|
||||
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
||||
setInputDevices(devices.filter((d) => d.kind === "audioinput"));
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -132,6 +132,10 @@ export const useMrtStore = create<MrtStore>(
|
||||
}
|
||||
case "sds": {
|
||||
const { sdsMessage } = pageData as SetSdsPageParams;
|
||||
const maxLen = 60;
|
||||
const msg = sdsMessage.data.message;
|
||||
const safeMsg =
|
||||
typeof msg === "string" && msg.length > maxLen ? msg.slice(0, maxLen) + "…" : msg;
|
||||
set({
|
||||
page: "sds",
|
||||
lines: [
|
||||
@@ -141,9 +145,17 @@ export const useMrtStore = create<MrtStore>(
|
||||
textSize: "2",
|
||||
},
|
||||
{
|
||||
textLeft: sdsMessage.data.message,
|
||||
style: {},
|
||||
textSize: "1",
|
||||
textLeft: safeMsg,
|
||||
style: {
|
||||
whiteSpace: "normal",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
maxWidth: "100%",
|
||||
width: "100%",
|
||||
display: "block",
|
||||
wordBreak: "break-word",
|
||||
},
|
||||
textSize: "2",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user