-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change visual presentation for remote software
- Loading branch information
1 parent
02c7604
commit 4389131
Showing
6 changed files
with
81 additions
and
24 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
26 changes: 26 additions & 0 deletions
26
frontend/components/software/overview/cards/ExternalLinkIcon.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-FileCopyrightText: 2025 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2025 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import OpenInNewIcon from '@mui/icons-material/OpenInNew' | ||
|
||
/** | ||
* It requires parent element to have tailwind "relative" class. | ||
* It requires parent element to have tailwind "group" class for changing to primary color on hover. | ||
* If domain is not provided or null it returns null/nothing. | ||
* @param domain string | ||
* @returns JSX.Element | null | ||
*/ | ||
export default function ExternalLinkIcon({domain}:Readonly<{domain?:string|null}>) { | ||
if (domain){ | ||
return ( | ||
<div | ||
title={domain} | ||
className="absolute right-0 top-0 p-2 z-[1] rounded-tr-md opacity-40 bg-base-100 group-hover:bg-primary group-hover:opacity-70 group-hover:text-primary-content"> | ||
<OpenInNewIcon sx={{width:'1.5rem', height: '1.5rem'}} /> | ||
</div> | ||
) | ||
} | ||
return null | ||
} |
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
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
33 changes: 33 additions & 0 deletions
33
frontend/components/software/overview/list/SourceBanner.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-FileCopyrightText: 2025 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2025 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import OpenInNewIcon from '@mui/icons-material/OpenInNew' | ||
|
||
type SourceRSDType = Readonly<{ | ||
source?:string|null, | ||
domain?:string|null | ||
}> | ||
|
||
export default function SourceBanner({source,domain}:SourceRSDType){ | ||
|
||
if (!source) return null | ||
|
||
return ( | ||
<div | ||
className="flex gap-2 py-1 uppercase font-medium group-hover:px-2 group-hover:bg-primary group-hover:text-primary-content" | ||
> | ||
<div | ||
title={domain ?? source} | ||
className="line-clamp-1 text-sm tracking-widest uppercase" | ||
> | ||
{source} | ||
</div> | ||
{ | ||
domain ? <OpenInNewIcon sx={{width:'1.25rem', height: '1.25rem'}} /> | ||
: null | ||
} | ||
</div> | ||
) | ||
} |