-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rvinnakota/refactor-commitdetailfileexp' of https://git…
…hub.com/codecov/gazebo into rvinnakota/refactor-commitdetailfileexp
- Loading branch information
Showing
16 changed files
with
238 additions
and
137 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 |
---|---|---|
@@ -1,9 +1,48 @@ | ||
import cs from 'classnames' | ||
import PropTypes from 'prop-types' | ||
|
||
const cardClassName = 'border border-ds-gray-secondary bg-white rounded-md ' | ||
const baseStyles = { | ||
header: 'text-2xl bold mb-4', | ||
footer: 'border-t border-ds-gray-secondary p-4', | ||
} | ||
|
||
// TODO: Make a card variant that creates a divisor bw entries, see Card from PullRequestPage | ||
const variantClasses = { | ||
default: 'border border-ds-gray-secondary rounded p-6', | ||
large: 'border border-ds-gray-secondary rounded p-12', | ||
upgradeForm: 'border border-ds-gray-secondary rounded p-12', | ||
cancel: 'border border-codecov-red px-12 py-10', | ||
old: 'border border-ds-gray-secondary bg-white rounded-md', | ||
} | ||
|
||
// TODO: enhance as per https://github.com/codecov/gazebo/pull/1433#discussion_r918864691 | ||
function Card({ | ||
children, | ||
header, | ||
footer, | ||
variant = 'default', | ||
className = '', | ||
}) { | ||
return ( | ||
<article className={cs(variantClasses[variant], className)}> | ||
{header && <div className={baseStyles.header}>{header}</div>} | ||
{children} | ||
{footer && <div className={baseStyles.footer}>{footer}</div>} | ||
</article> | ||
) | ||
} | ||
|
||
function Card({ children, className = '' }) { | ||
return <div className={cs(cardClassName, className)}>{children}</div> | ||
Card.propTypes = { | ||
header: PropTypes.node, | ||
footer: PropTypes.node, | ||
variant: PropTypes.oneOf([ | ||
'default', | ||
'large', | ||
'cancel', | ||
'upgradeForm', | ||
'old', | ||
]), | ||
className: PropTypes.string, | ||
} | ||
|
||
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
2 changes: 1 addition & 1 deletion
2
src/pages/AccountSettings/tabs/Admin/DeletionCard/DeletionCard.jsx
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
2 changes: 1 addition & 1 deletion
2
src/pages/AccountSettings/tabs/Profile/DeletionCard/DeletionCard.jsx
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
2 changes: 1 addition & 1 deletion
2
src/pages/PlanPage/subRoutes/CancelPlanPage/subRoutes/DowngradePlan/DowngradePlan.jsx
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.