-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acdf09e
commit 6855dae
Showing
9 changed files
with
181 additions
and
36 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
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,46 @@ | ||
import { CheckCircleSolid, EyeSolid, UserBadgeCheck } from "iconoir-react" | ||
import { OverlayTrigger, Tooltip } from "react-bootstrap" | ||
import { | ||
PlanIconColors, | ||
PlanIconLabels, | ||
PlanIconPublicDomainAccessNoDownload, | ||
PlanIconRestrictedAccessDownload, | ||
PlanIconRestrictedAccessNoDownload, | ||
} from "../constants" | ||
import type { PlanFeature } from "./PlanCard" | ||
const IconsByIconName: { [key: string]: React.ComponentType } = { | ||
[PlanIconRestrictedAccessNoDownload]: UserBadgeCheck, | ||
[PlanIconRestrictedAccessDownload]: UserBadgeCheck, | ||
[PlanIconPublicDomainAccessNoDownload]: EyeSolid, | ||
} | ||
|
||
const PlanFeatureCard: React.FC<{ feature: PlanFeature }> = ({ feature }) => { | ||
const Component = feature.icon | ||
? IconsByIconName[feature.icon] | ||
: CheckCircleSolid | ||
const color = feature.icon ? PlanIconColors[feature.icon] : "purple" | ||
|
||
if (feature.icon) { | ||
return ( | ||
<div className="PlanFeatureCard"> | ||
<OverlayTrigger | ||
overlay={ | ||
<Tooltip id="button-tooltip-2"> | ||
<span | ||
dangerouslySetInnerHTML={{ | ||
__html: PlanIconLabels[feature.icon], | ||
}} | ||
/> | ||
</Tooltip> | ||
} | ||
> | ||
<Component color={color} /> | ||
</OverlayTrigger> | ||
</div> | ||
) | ||
} | ||
|
||
return <Component color={color} /> | ||
} | ||
|
||
export default PlanFeatureCard |
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