Skip to content

Commit

Permalink
Fix : Asset cards in Asset list page is not a link. Unable to open in…
Browse files Browse the repository at this point in the history
… new tab (#5484)

* fixed readme typo

* fix: Asset cards in Asset list page is not a link. Unable to open in new tab

* fix: Asset cards in Asset list page is not a link. Unable to open in new tab

* Update src/Components/Assets/AssetsList.tsx

Co-authored-by: Rithvik Nishad <[email protected]>

* use tailwind instead of css

---------

Co-authored-by: Rithvik Nishad <[email protected]>
  • Loading branch information
souravghosh01 and rithviknishad authored May 24, 2023
1 parent 1616ab2 commit e818c0a
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { assetClassProps, AssetData } from "./AssetTypes";
import { getAsset } from "../../Redux/actions";
import { useState, useCallback, useEffect } from "react";
import { navigate } from "raviger";
import { Link, navigate } from "raviger";
import loadable from "@loadable/component";
import AssetFilter from "./AssetFilter";
import { parseQueryParams } from "../../Utils/primitives";
Expand Down Expand Up @@ -240,50 +240,50 @@ const AssetsList = () => {
manageAssets = (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 md:-mx-8 gap-2">
{assets.map((asset: AssetData) => (
<div
key={asset.id}
className="w-full bg-white rounded-lg cursor-pointer border-1 shadow p-5 justify-center items-center border border-transparent hover:border-primary-500"
onClick={() =>
navigate(
`facility/${asset?.location_object.facility.id}/assets/${asset.id}`
)
}
<Link
href={`/facility/${asset?.location_object.facility.id}/assets/${asset.id}`}
className="text-inherit"
>
<div className="md:flex">
<p className="text-xl flex font-medium capitalize break-words">
<span className="mr-2 text-primary-500">
<CareIcon
className={`care-l-${
(
(asset.asset_class &&
assetClassProps[asset.asset_class]) ||
assetClassProps.NONE
).icon
} text-2xl`}
/>
<div
key={asset.id}
className="w-full bg-white rounded-lg cursor-pointer border-1 shadow p-5 justify-center items-center border border-transparent hover:border-primary-500"
>
<div className="md:flex">
<p className="text-xl flex font-medium capitalize break-words">
<span className="mr-2 text-primary-500">
<CareIcon
className={`care-l-${
(
(asset.asset_class &&
assetClassProps[asset.asset_class]) ||
assetClassProps.NONE
).icon
} text-2xl`}
/>
</span>
<p className="truncate w-48">{asset.name}</p>
</p>
</div>
<p className="font-normal text-sm">
<span className="text-sm font-medium">
<CareIcon className="care-l-location-point mr-1 text-primary-500" />
{asset?.location_object?.name}
</span>
<span className="text-sm font-medium ml-2">
<CareIcon className="care-l-hospital mr-1 text-primary-500" />
{asset?.location_object?.facility?.name}
</span>
<p className="truncate w-48">{asset.name}</p>
</p>
</div>
<p className="font-normal text-sm">
<span className="text-sm font-medium">
<CareIcon className="care-l-location-point mr-1 text-primary-500" />
{asset?.location_object?.name}
</span>
<span className="text-sm font-medium ml-2">
<CareIcon className="care-l-hospital mr-1 text-primary-500" />
{asset?.location_object?.facility?.name}
</span>
</p>

<div className="flex flex-wrap gap-2 mt-2">
{asset.is_working ? (
<Chip color="green" startIcon="cog" text="Working" />
) : (
<Chip color="red" startIcon="cog" text="Not Working" />
)}
<div className="flex flex-wrap gap-2 mt-2">
{asset.is_working ? (
<Chip color="green" startIcon="cog" text="Working" />
) : (
<Chip color="red" startIcon="cog" text="Not Working" />
)}
</div>
</div>
</div>
</Link>
))}
</div>
);
Expand Down

0 comments on commit e818c0a

Please sign in to comment.