-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add Wearable Utility * fix: Rename WearableUtility to AssetUtility * fix: CategoryBadge types
- Loading branch information
1 parent
b6628f1
commit 654b3f5
Showing
31 changed files
with
222 additions
and
231 deletions.
There are no files selected for viewing
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
9 changes: 9 additions & 0 deletions
9
webapp/src/components/AssetPage/AssetUtility/AssetUtility.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,9 @@ | ||
.main :global(.ui.sub.header) { | ||
font-weight: 600; | ||
} | ||
|
||
.main .content { | ||
font-size: 14px; | ||
line-height: 26px; | ||
letter-spacing: 0.2px; | ||
} |
22 changes: 22 additions & 0 deletions
22
webapp/src/components/AssetPage/AssetUtility/AssetUtility.spec.tsx
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 @@ | ||
import { t } from 'decentraland-dapps/dist/modules/translation' | ||
import { renderWithProviders } from '../../../utils/test' | ||
import { ASSET_UTILITY_CONTENT_DATA_TEST_ID, ASSET_UTILITY_HEADER_DATA_TEST_ID, AssetUtility } from './AssetUtility' | ||
import { Props } from './AssetUtility.types' | ||
|
||
const renderWearableUtility = (props: Partial<Props>) => renderWithProviders(<AssetUtility utility="someUtility" {...props} />) | ||
|
||
describe('when rendering the wearable utility component', () => { | ||
let renderedComponent: ReturnType<typeof renderWearableUtility> | ||
let utility: string | ||
|
||
beforeEach(() => { | ||
utility = 'This is some utility!' | ||
renderedComponent = renderWearableUtility({ utility }) | ||
}) | ||
|
||
it('should render the utility header and the wearable utility', () => { | ||
const { getByTestId } = renderedComponent | ||
expect(getByTestId(ASSET_UTILITY_HEADER_DATA_TEST_ID).textContent).toEqual(t('global.utility')) | ||
expect(getByTestId(ASSET_UTILITY_CONTENT_DATA_TEST_ID).textContent).toEqual(utility) | ||
}) | ||
}) |
20 changes: 20 additions & 0 deletions
20
webapp/src/components/AssetPage/AssetUtility/AssetUtility.tsx
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,20 @@ | ||
import { t } from 'decentraland-dapps/dist/modules/translation' | ||
import { Header } from 'decentraland-ui/dist/components/Header/Header' | ||
import { Props } from './AssetUtility.types' | ||
import styles from './AssetUtility.module.css' | ||
|
||
export const ASSET_UTILITY_HEADER_DATA_TEST_ID = 'asset-utility-header' | ||
export const ASSET_UTILITY_CONTENT_DATA_TEST_ID = 'asset-utility-content' | ||
|
||
export const AssetUtility = ({ utility }: Props) => { | ||
return ( | ||
<div className={styles.main}> | ||
<Header sub data-testid={ASSET_UTILITY_HEADER_DATA_TEST_ID}> | ||
{t('global.utility')} | ||
</Header> | ||
<span data-testid={ASSET_UTILITY_CONTENT_DATA_TEST_ID} className={styles.content}> | ||
{utility} | ||
</span> | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
webapp/src/components/AssetPage/AssetUtility/AssetUtility.types.ts
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 = { | ||
utility: 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,2 @@ | ||
export * from './AssetUtility' | ||
export * from './AssetUtility.types' |
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
142 changes: 0 additions & 142 deletions
142
webapp/src/components/AssetPage/IconBadge/IconBadge.css
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.