-
Notifications
You must be signed in to change notification settings - Fork 4
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
22 changed files
with
465 additions
and
74 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
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,39 @@ | ||
import React from "react"; | ||
import "./RoleCard.scss"; | ||
import Logo from "./Logo"; | ||
import I18n from "../locale/I18n"; | ||
import {MoreLessText} from "./MoreLessText"; | ||
import {Button, Card, CardType, Checkbox, Chip, ChipType} from "@surfnet/sds"; | ||
import {useNavigate} from "react-router-dom"; | ||
import {isEmpty} from "../utils/Utils"; | ||
|
||
export const RoleCard = ({role, index, invitationSelected, invitationSelectCallback, isNew = false }) => { | ||
const navigate = useNavigate(); | ||
|
||
const application = role.application; | ||
const logo = role.application.data.metaDataFields["logo:0:url"]; | ||
|
||
const children = | ||
<div key={index} className="user-role"> | ||
{!isEmpty(invitationSelected) && | ||
<Checkbox name={"invitationSelected"} value={invitationSelected} onChange={invitationSelectCallback}/>} | ||
<Logo src={logo} alt={"provider"} className={"provider"}/> | ||
<section className={"user-role-info"}> | ||
<p>{application.data.metaDataFields[`name:${I18n.locale}`]} ({application.data.metaDataFields[`OrganizationName:${I18n.locale}`]})</p> | ||
<h3>{role.name}</h3> | ||
<MoreLessText txt={role.description}/> | ||
</section> | ||
{isEmpty(invitationSelected) && <div className={"launch"}> | ||
<Button txt={I18n.t("inviter.details")} onClick={() => navigate(`/roles/${role.id}`)}/> | ||
</div>} | ||
|
||
</div>; | ||
return ( | ||
<div className={`card-container ${isNew ? "is-new" : ""}`}> | ||
{isNew && | ||
<Chip label={I18n.t("proceed.new")} type={ChipType.Status_error}/> | ||
} | ||
<Card key={index} cardType={CardType.Big} children={children}/> | ||
</div> | ||
); | ||
} |
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,74 @@ | ||
@import "../styles/vars"; | ||
|
||
.card-container { | ||
|
||
button.sds--chips { | ||
background-color: #FFD700; | ||
} | ||
|
||
&.is-new { | ||
position: relative; | ||
|
||
.sds--chips { | ||
position: absolute; | ||
top: -16px; | ||
left: -22px; | ||
} | ||
|
||
@keyframes glow { | ||
0% { | ||
box-shadow: 1px 0.13rem 0.13rem 0 #FFD700; | ||
border: 0.0625rem solid #FFD700; | ||
} | ||
50% { | ||
box-shadow: 1px 0.16rem 0.16rem 0 #eac602; | ||
border: 0.0625rem solid #eac602; | ||
} | ||
100% { | ||
box-shadow: 1px 0.13rem 0.13rem 0 #FFD700; | ||
border: 0.0625rem solid #FFD700; | ||
} | ||
} | ||
|
||
.sds--card { | ||
animation: glow 2.5s infinite; | ||
} | ||
|
||
} | ||
|
||
.user-role { | ||
display: flex; | ||
align-items: center; | ||
|
||
@media (max-width: 680px) { | ||
flex-direction: column; | ||
} | ||
|
||
img, svg { | ||
height: 56px; | ||
width: auto; | ||
margin: 0 35px auto 0; | ||
border-radius: $br; | ||
|
||
@media (max-width: 680px) { | ||
margin: 0 auto 20px 0; | ||
} | ||
} | ||
|
||
.launch { | ||
margin-left: auto; | ||
|
||
@media (max-width: 680px) { | ||
margin: 20px auto 0 0; | ||
} | ||
|
||
} | ||
|
||
|
||
.user-role-info { | ||
h3 { | ||
margin: 10px 0; | ||
} | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.