-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cypress-parallel' of github.com:coronasafe/care_fe into…
… cypress-parallel
- Loading branch information
Showing
22 changed files
with
333 additions
and
128 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 @@ | ||
test -f .env.local && dotenv .env.local |
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 |
---|---|---|
|
@@ -56,7 +56,7 @@ describe("Asset", () => { | |
"[email protected]", | ||
"Vendor's Name", | ||
serialNumber, | ||
"2021-12-25", | ||
"25122021", | ||
"Test note for asset creation!" | ||
); | ||
|
||
|
@@ -80,7 +80,7 @@ describe("Asset", () => { | |
"[email protected]", | ||
"Vendor's Name", | ||
serialNumber, | ||
"2021-12-25", | ||
"25122021", | ||
"Test note for asset creation!" | ||
); | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 { classNames } from "../../Utils/utils"; | ||
|
||
interface Props<T extends string> { | ||
tabs: Record<T, string>; | ||
selected: T; | ||
onChange: (tab: T) => void; | ||
size?: "sm" | "md" | "lg"; | ||
} | ||
|
||
export default function Switch<T extends string>({ | ||
size = "sm", | ||
...props | ||
}: Props<T>) { | ||
return ( | ||
<ul role="list" className="flex"> | ||
{Object.keys(props.tabs).map((tab) => { | ||
return ( | ||
<li | ||
key={tab} | ||
tabIndex={0} | ||
className={classNames( | ||
"cursor-pointer select-none border shadow-sm outline-none transition-all duration-200 ease-in-out first:rounded-l last:rounded-r focus:ring-1", | ||
size === "sm" && "px-2 py-1 text-xs", | ||
size === "md" && "px-3 py-2 text-sm", | ||
size === undefined && "px-3 py-2 text-sm", | ||
size === "lg" && "px-4 py-3 text-base", | ||
props.selected === tab | ||
? "border-primary-500 bg-primary-500 font-semibold text-white hover:bg-primary-600 focus:border-primary-500 focus:ring-primary-500" | ||
: "border-gray-400 bg-gray-50 hover:bg-gray-200 focus:border-primary-500 focus:ring-primary-500" | ||
)} | ||
onClick={() => props.onChange(tab as T)} | ||
> | ||
{props.tabs[tab as T]} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
); | ||
} |
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.