-
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.
Merge pull request #22 from roziqinkhoeru/main
`refactor` single responsibility principle
- Loading branch information
Showing
10 changed files
with
87 additions
and
79 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,37 @@ | ||
import { PlusIcon } from 'lucide-react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { HeaderContainerProps } from '../types'; | ||
|
||
function HeaderContainer({ | ||
title, | ||
subtitle, | ||
btnHref, | ||
btnText, | ||
}: HeaderContainerProps) { | ||
return ( | ||
<div className="flex justify-between"> | ||
<div className=""> | ||
<h5 className="font-semibold text-3xl mb-1.5">{title}</h5> | ||
<p className="text-gray-500">{subtitle}</p> | ||
</div> | ||
{btnHref && btnText && ( | ||
<div className=""> | ||
<Link | ||
type="button" | ||
className="leading-normal ml-4 inline-flex justify-center rounded-lg border border-transparent bg-violet-600 px-4 py-2.5 text-sm font-medium text-gray-100 hover:bg-violet-500 focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-violet-500 disabled:focus-visible:ring-2 disabled:focus-visible:ring-violet-500 disabled:focus-visible:ring-offset-2" | ||
to={btnHref}> | ||
<PlusIcon | ||
size={20} | ||
className="mr-1.5 stroke-current" | ||
strokeWidth={2} | ||
/> | ||
{btnText} | ||
</Link> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default HeaderContainer; |
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
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
Empty file.
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