fix: Do not hide Preview button & color code it

This commit is contained in:
blessedcoolant 2023-05-01 10:56:35 +12:00 committed by psychedelicious
parent d4b250d509
commit a4313c26cb

View File

@ -53,7 +53,9 @@ const ProgressImagePreview = () => {
const { t } = useTranslation();
return showProgressWindow ? (
return (
<>
{showProgressWindow && (
<Rnd
bounds="window"
minHeight={200}
@ -72,7 +74,12 @@ const ProgressImagePreview = () => {
onResizeStop={(e, direction, ref, delta, position) => {
const newRect: Partial<Rect> = {};
console.log(ref.style.width, ref.style.height, position.x, position.y);
console.log(
ref.style.width,
ref.style.height,
position.x,
position.y
);
if (ref.style.width) {
newRect.width = ref.style.width;
@ -174,18 +181,25 @@ const ProgressImagePreview = () => {
)}
</Flex>
</Rnd>
) : (
)}
<IAIIconButton
onClick={() => dispatch(setShouldShowProgressImages(true))}
onClick={() =>
dispatch(setShouldShowProgressImages(!showProgressWindow))
}
tooltip={t('ui.showProgressImages')}
sx={{
position: 'absolute',
bottom: 4,
insetInlineStart: 4,
background: showProgressWindow ? 'accent.600' : 'base.700',
_hover: {
background: showProgressWindow ? 'accent.500' : 'base.600',
},
}}
aria-label={t('ui.showProgressImages')}
icon={<FaStopwatch />}
/>
</>
);
};