Skip to content

Commit

Permalink
updated the logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ANKUR DWIVEDI authored and ANKUR DWIVEDI committed Jul 9, 2024
1 parent 7928266 commit 2d65ef6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ jobs:
with:
start: npm run serve:app-router
wait-on: 'http://localhost:3000'
record: true
env:
DEBUG: 'cypress:server:browsers:electron'
CI: true
NEXT_PUBLIC_PUBLIC_KEY: ${{ secrets.IK_PUBLIC_KEY }}
PRIVATE_KEY: ${{ secrets.IK_PRIVATE_KEY }}
NEXT_PUBLIC_URL_ENDPOINT: ${{ secrets.IK_URL_ENDPOINT }}
CYPRESS_RECORD_KEY: c008f3e4-aff9-4acb-8e41-01b0bad9510a

- name: tar workspace
if: always()
Expand Down
1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default defineConfig({
fixturesFolder: 'cypress/fixtures',
screenshotsFolder: 'screenshots',
videosFolder: 'videos',
projectId: "nfkjt7",
env: {
APP_HOST: 'http://localhost:3000/',
},
Expand Down
8 changes: 0 additions & 8 deletions src/components/IKImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,10 @@ const IKImage = (props: Omit<ImageProps, "src" | "loading" | "loader"> & IKImage

useEffect(() => {
// if height and width are there in transformation skip props height and width and add fill =true
if(props.loading==='lazy')
console.log({restProps})
const updatedRestProps = restProps;
if (
transformation?.length &&
transformation.some((obj) => obj.hasOwnProperty('height') || obj.hasOwnProperty('width'))
// (hasProperty(transformation, "height") || hasProperty(transformation, "width"))
) {
if (updatedRestProps.height) delete updatedRestProps["height"];
if (updatedRestProps.width) delete updatedRestProps["width"];
Expand All @@ -152,10 +149,6 @@ const IKImage = (props: Omit<ImageProps, "src" | "loading" | "loader"> & IKImage
setImageProps(updatedRestProps);
}, []);

useEffect(() => {
if (props.loading === "lazy") console.log({ currentUrl, loading: props.loading,imageProps });
}, [currentUrl, props.loading,imageProps]);

return currentUrl != undefined && Object.keys(imageProps).length ? (
<NextImage
loader={({ src }) => src}
Expand All @@ -164,7 +157,6 @@ const IKImage = (props: Omit<ImageProps, "src" | "loading" | "loader"> & IKImage
ref={imageRef}
unoptimized
loading="eager"
// fill={transformation?.length && (hasProperty(transformation, "height") || hasProperty(transformation, "width")) ? true : false}
{...imageProps}
/>
) : (
Expand Down

0 comments on commit 2d65ef6

Please sign in to comment.