-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refacto components organization (#111)
* refacto(front): move Alert component in atoms * refacto(front): create component for create stack card * refacto(front): create generic Card component
- Loading branch information
1 parent
6a26a24
commit a060c91
Showing
8 changed files
with
72 additions
and
29 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import Button from "../atoms/forms/Button.atom"; | ||
import { BiTrash, BiEdit, BiCopy } from "react-icons/bi"; | ||
import { IStack } from "../../interfaces/Stack.interface"; | ||
|
||
const CardOrganism = ({ id, name, description, linkUrl, isEditable, onDelete, onEdit, onDuplicate } : { | ||
id: string | ||
name: string | ||
description: string | ||
linkUrl: string | ||
isEditable: boolean | ||
onDelete: (id: string) => void | ||
onEdit: () => void | ||
onDuplicate: (id: string) => void | ||
}) => { | ||
return ( | ||
<div className="card shadow-md mb-2 rounded border border-blue-100 hover:border-blue-200"> | ||
<Link to={`${linkUrl}/${id}`} key={id}> | ||
<div className="card-body"> | ||
<h2 className="card-title">{name}</h2> | ||
<p className="truncate">{description}</p> | ||
</div> | ||
</Link> | ||
|
||
{ isEditable && ( | ||
<div className="card-actions justify-end"> | ||
<Button className="btn-ghost" icon={<BiTrash/>} onClick={() => { onDelete(id) }} /> | ||
<Button className="btn-ghost" icon={<BiEdit/>} onClick={onEdit} /> | ||
<Button className="btn-ghost" icon={<BiCopy/>} onClick={() => { onDuplicate(id) }} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default CardOrganism; |
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,18 @@ | ||
import React from "react"; | ||
|
||
const StackCardOrganism = ({ onOpenModal }: { | ||
onOpenModal: (undefined: undefined) => void | ||
}): JSX.Element => { | ||
return ( | ||
<button | ||
onClick={() => { onOpenModal(undefined) }} | ||
className="card shadow-md mb-2 rounded bg-blue-100 border border-blue-100 hover:border-blue-200"> | ||
<div className="card-body"> | ||
<h2 className="card-title">+ Create a new stack</h2> | ||
<p>Click here to create a new stack</p> | ||
</div> | ||
</button> | ||
); | ||
} | ||
|
||
export default StackCardOrganism; |
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