generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from Real-Dev-Squad/develop
Merge Develop to Main
- Loading branch information
Showing
19 changed files
with
323 additions
and
460 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Contributing to RDS Status-Site | ||
- [How to Start](#1.-how-to-start) | ||
- [Yarn Command Reference](#2.-yarn-command-reference) | ||
- [API Contracts](#3.-api-contracts) | ||
- [Setting Up Local System](#4.-setting-up-local-system) | ||
|
||
## **1. How to Start** | ||
|
||
Follow this [link](https://github.com/Real-Dev-Squad/website-welcome/blob/main/CONTRIBUTING.md) to understand how to clone,fork and do a PR. | ||
## **2. Yarn Command Reference** | ||
## Set-up | ||
`yarn install` | ||
|
||
## Development | ||
To run the project `yarn run dev`. | ||
|
||
## Production | ||
To do a production build `yarn run start`. | ||
|
||
## **3. API Contracts** | ||
API contracts can be found [here](https://github.com/Real-Dev-Squad/website-api-contracts/tree/main/tasks). | ||
|
||
## **4. Setting Up Local System** | ||
1. **Get Authenticated cookie** | ||
Click [this](https://github.com/login/oauth/authorize?client_id=c4a84431feaf604e89d1) link to redirect to authenticating page. | ||
2. **To get the CORS error resolved follow this doc** | ||
https://github.com/Real-Dev-Squad/website-code-docs/tree/main/docs/dev/https-dev-url-cors | ||
|
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,126 @@ | ||
import { FC } from 'react'; | ||
import classNames from '@/components/Card/card.module.scss'; | ||
|
||
type Props = { | ||
title: { | ||
text: string, | ||
link?: string | ||
}, | ||
data: { | ||
key: string, | ||
value: string | ||
}[], | ||
assignee?: | ||
{ | ||
userName: string, | ||
imgUrl: string, | ||
onError:() => void | ||
}, | ||
participants?: | ||
{ | ||
firstName: string, | ||
lastName: string, | ||
userName: string, | ||
imgUrl: string, | ||
}[], | ||
button?: { | ||
text: string, | ||
link?: string, | ||
onClick?: () => void | ||
}; | ||
}; | ||
|
||
const Card: FC<Props> = ({ | ||
title, data, assignee = undefined, participants = undefined, button = undefined, | ||
}) => { | ||
const { text: tileText } = title; | ||
|
||
const informationElement = (key: string, value: string) => ( | ||
<span className={classNames.statusElement}> | ||
<span className={classNames.statusLable}>{`${key}: `}</span> | ||
<strong>{value}</strong> | ||
</span> | ||
); | ||
|
||
return ( | ||
<div | ||
className={classNames.card} | ||
onClick={() => { | ||
if (title.link) { | ||
window.open(title.link, '_blank'); | ||
} | ||
}} | ||
onKeyDown={() => { | ||
if (title.link) { | ||
window.open(title.link, '_blank'); | ||
} | ||
}} | ||
role="button" | ||
tabIndex={0} | ||
> | ||
|
||
<span className={classNames.prTitle}>{tileText}</span> | ||
|
||
<div> | ||
{data.map((pair) => ( | ||
<div key={pair.key}> | ||
{informationElement(pair.key, pair.value)} | ||
</div> | ||
))} | ||
</div> | ||
|
||
{ | ||
(assignee) && ( | ||
<div className={classNames.cardFooter}> | ||
<div className={classNames.profilePicture}> | ||
<img | ||
src={assignee.imgUrl} | ||
alt={assignee.userName} | ||
onError={assignee.onError} | ||
/> | ||
<strong>{assignee.userName || 'No contributor'}</strong> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
{ | ||
(participants) && ( | ||
<div className={classNames.Center}> | ||
<ul className={classNames.participantsLists}> | ||
{ | ||
participants.map((participant) => ( | ||
<li key={participant.userName} className={classNames.participantsList}> | ||
<img | ||
src={participant.imgUrl} | ||
alt={`${participant.firstName} ${participant.lastName}`} | ||
/> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</div> | ||
) | ||
} | ||
|
||
{ | ||
(button) && ( | ||
<div className={classNames.Center}> | ||
<a | ||
href={button?.link} | ||
className={classNames.links} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<button type="button" onClick={button?.onClick} className={classNames.activeBtn}> | ||
{button.text} | ||
</button> | ||
</a> | ||
</div> | ||
) | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Card; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.