-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/lw-collection-and-item-loader
- Loading branch information
Showing
9 changed files
with
142 additions
and
115 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,3 @@ | ||
export type Props = { | ||
className?: string | ||
} |
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,64 @@ | ||
.linkedTooltip { | ||
display: grid; | ||
width: 458px; | ||
margin: 14px; | ||
grid-template-columns: auto auto; | ||
gap: 4px; | ||
overflow: hidden; | ||
} | ||
|
||
.gridItem { | ||
position: relative; | ||
padding: 10px; | ||
display: flex; | ||
align-items: start; | ||
} | ||
|
||
.mappingExample { | ||
color: #cfcdd4; | ||
} | ||
|
||
.mappingType { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.mappingDescription { | ||
flex-direction: column; | ||
} | ||
|
||
.mappingIcon { | ||
width: 20px; | ||
height: 20px; | ||
margin-right: 10px; | ||
} | ||
|
||
.tooltipHeader { | ||
display: flex; | ||
align-items: center; | ||
grid-column-start: 1; | ||
grid-column-end: 3; | ||
padding: 10px; | ||
text-transform: uppercase; | ||
} | ||
|
||
.tooltipHeader img { | ||
width: 20px; | ||
height: 20px; | ||
margin-right: 10px; | ||
} | ||
|
||
.gridItem::before, | ||
.gridItem::after { | ||
content: ''; | ||
position: absolute; | ||
background-color: #a09ba8; | ||
z-index: 1; | ||
} | ||
|
||
.gridItem::after { | ||
width: 100vw; | ||
height: 1px; | ||
left: 0; | ||
top: -1px; | ||
} |
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,50 @@ | ||
import classNames from 'classnames' | ||
import { InfoTooltip } from 'decentraland-ui' | ||
import { t } from 'decentraland-dapps/dist/modules/translation' | ||
import { MappingType } from '@dcl/schemas' | ||
import allIcon from '../../icons/all.svg' | ||
import multipleIcon from '../../icons/multiple.svg' | ||
import singleIcon from '../../icons/single.svg' | ||
import rangeIcon from '../../icons/range.svg' | ||
import lightbulbIcon from '../../icons/lightbulb.svg' | ||
import styles from './LinkedToTooltip.module.css' | ||
import { Props } from './LinkedToToolip.types' | ||
|
||
const mappingTypeIcons = { | ||
[MappingType.ANY]: allIcon, | ||
[MappingType.MULTIPLE]: multipleIcon, | ||
[MappingType.SINGLE]: singleIcon, | ||
[MappingType.RANGE]: rangeIcon | ||
} | ||
|
||
const LinkingTooltipMappingType = ({ type }: { type: MappingType }) => { | ||
return ( | ||
<> | ||
<div className={styles.gridItem}> | ||
<div className={styles.mappingType}> | ||
<img className={styles.mappingIcon} src={mappingTypeIcons[type]} /> | ||
{t(`mapping_editor.mapping_types.${type}`)} | ||
</div> | ||
</div> | ||
<div className={classNames(styles.gridItem, styles.mappingDescription)}> | ||
<div>{t(`mapping_editor.mapping_descriptions.${type}`)}</div> | ||
{type !== MappingType.ANY && <div className={styles.mappingExample}>{t(`mapping_editor.mapping_examples.${type}`)}</div>} | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export const LinkingToTooltip = ({ className }: Props) => ( | ||
<InfoTooltip className={className}> | ||
<div className={styles.linkedTooltip}> | ||
<div className={styles.tooltipHeader}> | ||
<img src={lightbulbIcon} /> | ||
{t('collection_row.linking_tooltip.title')} | ||
</div> | ||
<LinkingTooltipMappingType type={MappingType.ANY} /> | ||
<LinkingTooltipMappingType type={MappingType.SINGLE} /> | ||
<LinkingTooltipMappingType type={MappingType.MULTIPLE} /> | ||
<LinkingTooltipMappingType type={MappingType.RANGE} /> | ||
</div> | ||
</InfoTooltip> | ||
) |
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 @@ | ||
export * from './LinkedToTooltip' |
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