Skip to content

Commit

Permalink
refactor: set ref
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Sep 23, 2024
1 parent ebf8d71 commit 0260520
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/common/ImageFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { useAppTranslation } from '@/config/i18n';
import { hooks } from '@/config/queryClient';
import { APP } from '@/langs/constants';

import { useImageDimensionsContext } from '../context/imageDimensionContext';

const ImageFrame = (): JSX.Element | null => {
const {
data: image,
Expand All @@ -13,6 +15,7 @@ const ImageFrame = (): JSX.Element | null => {
} = hooks.useAppSettings({
name: SettingsKeys.File,
});
const { imgRef } = useImageDimensionsContext();

const appSettingId = image?.[0]?.id || '';

Expand All @@ -31,6 +34,7 @@ const ImageFrame = (): JSX.Element | null => {
height="100%"
>
<img
ref={imgRef}
src={URL.createObjectURL(dataFile)}
alt="frame"
style={{
Expand Down

0 comments on commit 0260520

Please sign in to comment.