From e683063c192f4b2df74221ec2abf26c405267f27 Mon Sep 17 00:00:00 2001
From: Victor Thomas <10986371+vthomas13@users.noreply.github.com>
Date: Fri, 9 Jun 2023 18:30:29 -0400
Subject: [PATCH 01/35] layout wip
---
.../activity-list-item/activity-list-item.js | 137 ++++++++++++++++++
.../activity-list-item.stories.js | 69 +++++++++
.../multichain/activity-list-item/index.js | 1 +
3 files changed, 207 insertions(+)
create mode 100644 ui/components/multichain/activity-list-item/activity-list-item.js
create mode 100644 ui/components/multichain/activity-list-item/activity-list-item.stories.js
create mode 100644 ui/components/multichain/activity-list-item/index.js
diff --git a/ui/components/multichain/activity-list-item/activity-list-item.js b/ui/components/multichain/activity-list-item/activity-list-item.js
new file mode 100644
index 000000000000..f24ce704af8c
--- /dev/null
+++ b/ui/components/multichain/activity-list-item/activity-list-item.js
@@ -0,0 +1,137 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+import {
+ BlockSize,
+ BorderColor,
+ Display,
+ FlexDirection,
+ FlexWrap,
+ FontWeight,
+ JustifyContent,
+ TextAlign,
+ TextColor,
+ TextVariant,
+} from '../../../helpers/constants/design-system';
+import { Box, Text } from '../../component-library';
+
+export const ActivityListItem = ({
+ topContent,
+ icon,
+ title,
+ subtitle,
+ midContent,
+ children,
+ rightContent,
+ onClick,
+ className,
+ 'data-testid': dataTestId,
+}) => {
+ const primaryClassName = classnames(
+ 'activity-list-item',
+ className,
+ subtitle || children ? '' : 'activity-list-item--single-content-row',
+ );
+
+ return (
+
Content rendered to the right
; +const CHILDREN =Content rendered in the middle
; +const TOP_CONTENT =Content rendered at the top
; + +describe('ActivityListItem', () => { + const defaultProps = { + className: CLASSNAME, + title: TITLE, + 'data-testid': 'test-id', + subtitle: SUBTITLE, + rightContent: RIGHT_CONTENT, + midContent: MID_CONTENT, + topContent: TOP_CONTENT, + icon: {
- if (event.key === 'Enter') {
- onClick();
- }
- }}
padding={4}
display={Display.Flex}
width={BlockSize.Full}
From 388ba19c0420f5c74357e79bfd8a26f34ecad625 Mon Sep 17 00:00:00 2001
From: David Walsh
Hello World
diff --git a/ui/components/multichain/activity-list-item/activity-list-item.js b/ui/components/multichain/activity-list-item/activity-list-item.js index 93d4255c2afb..d4f8dd5c9ef8 100644 --- a/ui/components/multichain/activity-list-item/activity-list-item.js +++ b/ui/components/multichain/activity-list-item/activity-list-item.js @@ -77,6 +77,7 @@ export const ActivityListItem = ({ textAlign={TextAlign.Left} variant={TextVariant.bodyLgMedium} fontWeight={FontWeight.Medium} + data-testid="activity-list-item-action" > {title} From b5b9ec8d0d2ca4e7b0aae68bea2c1dd62ef3da7e Mon Sep 17 00:00:00 2001 From: David WalshContent rendered to the right @@ -92,6 +94,6 @@ exports[`ActivityListItem should match snapshot with props 1`] = `
I am a list item
- +
Content rendered at the top @@ -58,13 +58,13 @@ exports[`ActivityListItem should match snapshot with props 1`] = ` class="mm-box activity-list-item__detail-container mm-box--display-inline-flex mm-box--flex-direction-column mm-box--width-1/3 mm-box--sm:width-7/12" >
Hello World
I am a list item