Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include all the marketplace feedbacks
- Loading branch information
Showing
7 changed files
with
259 additions
and
87 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
71 changes: 46 additions & 25 deletions
71
website/src/pages/marketplace/_components/MarketplaceCard/index.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
53 changes: 53 additions & 0 deletions
53
website/src/pages/marketplace/_components/MarketplaceCardTag/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from "react"; | ||
import { tagTypes } from "../../../../data/rulesmarketplace"; | ||
import styles from "./styles.module.css"; | ||
|
||
// const TagComp = React.forwardRef<HTMLLIElement>( | ||
// ({label, color, description}, ref) => ( | ||
// <li ref={ref} className={styles.tag} title={description}> | ||
// <span className={styles.textLabel}>{label.toLowerCase()}</span> | ||
// <span className={styles.colorLabel} style={{backgroundColor: color}} /> | ||
// </li> | ||
// ), | ||
// ); | ||
|
||
function MarketplaceCardTag(input) { | ||
|
||
const tag = input.tag; | ||
|
||
function getColorForTag(tag) { | ||
if (tag in tagTypes) { | ||
return tagTypes[tag].color; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
function getDescriptionForTag(tag) { | ||
if (tag in tagTypes) { | ||
return tagTypes[tag].description; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
return ( | ||
<li title={getDescriptionForTag(tag)} className={styles.tag}> | ||
<span className={styles.textLabel}>{input.tag.toLowerCase()}</span> | ||
<span | ||
className={styles.colorLabel} | ||
style={{ backgroundColor: getColorForTag(tag) }} | ||
/> | ||
</li> | ||
// <Tooltip | ||
// key={index} | ||
// text={tagObject.description} | ||
// anchorEl="#__docusaurus" | ||
// id={id} | ||
// > | ||
// <TagComp key={index} {...tagObject} /> | ||
// </Tooltip> | ||
); | ||
} | ||
|
||
export default React.memo(MarketplaceCardTag); |
22 changes: 22 additions & 0 deletions
22
website/src/pages/marketplace/_components/MarketplaceCardTag/styles.module.css
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,22 @@ | ||
.tag { | ||
font-size: 0.675rem; | ||
border: 1px solid var(--ifm-color-secondary-darkest); | ||
cursor: default; | ||
margin-right: 6px; | ||
margin-bottom: 6px !important; | ||
border-radius: 12px; | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
|
||
.tag .textLabel { | ||
margin-left: 8px; | ||
} | ||
|
||
.tag .colorLabel { | ||
width: 7px; | ||
height: 7px; | ||
border-radius: 50%; | ||
margin-left: 6px; | ||
margin-right: 6px; | ||
} |
Oops, something went wrong.