decord/beta/source/modules/chat/native/useChatWidth.tsx

58 lines
1.7 KiB
TypeScript
Raw Normal View History

// Module ID: 11020
// Function ID: 11021
// Name: useChatWidth
// Dependencies: [19, 4695, 4697, 11021, 11022, 2]
// Exports: default, getChatWidth
// Module 11020 (useChatWidth)
import useChatLayout from "useChatLayout" /* 4695 */;
import useBaseAppContainerDimensions from "useBaseAppContainerDimensions" /* 4697 */;
import useDrawerWidth from "useDrawerWidth" /* 11021 */;
2026-10-01 14:13:23 +00:00
import reactDefault from "react" /* 11022 */;
import react from "react" /* 19 */;
import size from "module_2" /* 2 */;
const useChatLayoutDefault = useChatLayout;
const useBaseAppContainerDimensionsDefault = useBaseAppContainerDimensions;
const result = size.fileFinishedImporting("modules/chat/native/useChatWidth.tsx");
export default function useChatWidth(arg0) {
2026-10-01 14:13:23 +00:00
let context = react.useContext(reactDefault);
const isChatLockedOpen = useChatLayoutDefault().isChatLockedOpen;
const width = useBaseAppContainerDimensionsDefault().width;
useDrawerWidth;
if (null == context) {
2026-10-01 14:13:23 +00:00
let tmp5;
if (null == arg0) {
let diff = width;
2026-10-01 14:13:23 +00:00
if (isChatLockedOpen) {
diff = width - tmp3;
}
2026-10-01 14:13:23 +00:00
tmp5 = diff;
} else {
tmp5 = width;
}
context = tmp5;
}
return context;
};
export const getChatWidth = function getChatWidth(arg0) {
2026-10-01 14:13:23 +00:00
let tmp3;
const obj = useChatLayout;
2026-10-01 14:13:23 +00:00
const isChatLockedOpen = obj.getChatLayout().isChatLockedOpen;
const obj2 = useBaseAppContainerDimensions;
const width = obj2.getBaseAppContainerDimensions().width;
if (null == arg0) {
let diff = width;
2026-10-01 14:13:23 +00:00
if (isChatLockedOpen) {
const tmpResult = useDrawerWidth;
2026-10-01 14:13:23 +00:00
diff = width - tmpResult.getDrawerWidth();
}
2026-10-01 14:13:23 +00:00
tmp3 = diff;
} else {
tmp3 = width;
}
return tmp3;
};