-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 14 additions & 18 deletions
32
src/components/DynamicObject/ObjectActiveModules/ObjectCard/ObjectCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,39 @@ | ||
import { Badge, Heading } from '@pzh-ui/components' | ||
import { AngleRight } from '@pzh-ui/icons' | ||
import { Badge, Button, Heading, Text } from '@pzh-ui/components' | ||
import { Link } from 'react-router-dom' | ||
|
||
import { Module } from '@/api/fetchers.schemas' | ||
import { getModuleStatusColor } from '@/utils/module' | ||
|
||
const ModuleTile = ({ Title, Status, Module_ID, Closed }: Module) => { | ||
const Wrapper = Closed ? 'div' : Link | ||
|
||
return ( | ||
<Wrapper | ||
to={!Closed ? `/muteer/modules/${Module_ID}` : ''} | ||
data-testid="dashboard-module-tile"> | ||
<div className="group grid grid-cols-8 rounded border border-pzh-gray-200 p-4"> | ||
<div className="order-1 col-span-7 flex items-center sm:col-span-5"> | ||
<Heading level="3" size="s"> | ||
{Title} | ||
</Heading> | ||
</div> | ||
<div className="order-3 col-span-8 mt-2 sm:order-2 sm:col-span-2 sm:mt-0"> | ||
<Badge | ||
text={Status?.Status.replace('-', ' ') || ''} | ||
variant={getModuleStatusColor(Status?.Status)} | ||
upperCase={false} | ||
className="-mt-1 whitespace-nowrap" | ||
/> | ||
</div> | ||
{!Closed && ( | ||
<div className="order-2 col-span-1 flex items-center justify-end sm:order-3"> | ||
<div className="transition group-hover:translate-x-1"> | ||
<AngleRight | ||
size={18} | ||
className="text-pzh-green-500" | ||
/> | ||
</div> | ||
</div> | ||
)} | ||
const ModuleTile = ({ Title, Description, Status, Module_ID }: Module) => ( | ||
<Link | ||
to={`/muteer/modules/${Module_ID}`} | ||
data-testid="dashboard-module-tile"> | ||
<div className="group rounded border border-pzh-gray-200 p-6"> | ||
<div className="mb-4"> | ||
<Heading level="3" size="m"> | ||
{Title} | ||
</Heading> | ||
<Text size="s" className="line-clamp-3"> | ||
{Description} | ||
</Text> | ||
</div> | ||
<div className="flex items-center justify-between"> | ||
<Badge | ||
text={Status?.Status.replace('-', ' ') || ''} | ||
variant={getModuleStatusColor(Status?.Status)} | ||
upperCase={false} | ||
solid | ||
className="whitespace-nowrap" | ||
/> | ||
<Button | ||
variant="link" | ||
size="small" | ||
className="text-pzh-green-500 group-hover:text-pzh-green-900 group-hover:no-underline"> | ||
Bekijk module | ||
</Button> | ||
</div> | ||
</Wrapper> | ||
) | ||
} | ||
</div> | ||
</Link> | ||
) | ||
|
||
export default ModuleTile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters