Skip to content

Commit

Permalink
Fix dashboard images
Browse files Browse the repository at this point in the history
  • Loading branch information
vhande committed Oct 22, 2024
1 parent 5d32a49 commit 9506eac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const moduleExports = {
hotjarEventName: process.env.NEXT_PUBLIC_HOTJAR_EVENT_NAME,
hotjarMissingFieldName: process.env.NEXT_PUBLIC_HOTJAR_MISSING_FIELD_NAME,
ownershipEnabled: process.env.NEXT_PUBLIC_OWNERSHIP_ENABLED,
imgixUrl: process.env.NEXT_PUBLIC_IMGIX_URL,
},
pageExtensions: ['page.tsx', 'page.js', 'api.ts'],
eslint: {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/dashboard/DashboardRow.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import getConfig from 'next/config';
import { ReactNode, useMemo, useState } from 'react';

import { ScopeTypes } from '@/constants/OfferType';
Expand Down Expand Up @@ -61,12 +62,13 @@ export const DashboardRow = ({
...props
}: DashboardRowProps) => {
const getValue = getValueFromTheme('dashboardPage');
const { publicRuntimeConfig } = getConfig();
const { udbMainPositiveGreen, udbMainLightGreen, udbMainGrey, grey3 } =
colors;
const [isImageHovered, setIsImageHovered] = useState(false);
const weights = getScopeWeights(scope);
const minimumScore = useMemo(() => getMinimumScore(weights), [weights]);
const croppedImageBaseUrl = 'https://images-acc-uitdatabank.imgix.net/';
const croppedImageBaseUrl = publicRuntimeConfig.imgixUrl;
const imageIdAndFormat = imageUrl?.split('/').at(-1);
const croppedImageUrl = imageUrl
? `${croppedImageBaseUrl}${imageIdAndFormat}?fit=crop&crop=auto&w=500&h=500`
Expand Down

0 comments on commit 9506eac

Please sign in to comment.