From 46adb601af7a8a17ebcc3b53d44a7268fe5c66ef Mon Sep 17 00:00:00 2001 From: dcodes05 Date: Sat, 9 Sep 2023 21:08:57 +0200 Subject: [PATCH] feat: history transaction icons --- .../components/TransactionIcon.stories.tsx | 41 +++++++++++ .../src/components/TransactionIcon.tsx | 68 +++++++++++++++++++ libs/shared/assets/files/Received.svg | 14 ++++ libs/shared/assets/files/Send.svg | 14 ++++ libs/shared/assets/files/Swap.svg | 17 +++++ libs/shared/assets/files/Yield.svg | 17 +++++ 6 files changed, 171 insertions(+) create mode 100644 libs/oeth/history/src/components/TransactionIcon.stories.tsx create mode 100644 libs/oeth/history/src/components/TransactionIcon.tsx create mode 100644 libs/shared/assets/files/Received.svg create mode 100644 libs/shared/assets/files/Send.svg create mode 100644 libs/shared/assets/files/Swap.svg create mode 100644 libs/shared/assets/files/Yield.svg diff --git a/libs/oeth/history/src/components/TransactionIcon.stories.tsx b/libs/oeth/history/src/components/TransactionIcon.stories.tsx new file mode 100644 index 000000000..fc9191b1e --- /dev/null +++ b/libs/oeth/history/src/components/TransactionIcon.stories.tsx @@ -0,0 +1,41 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { TransactionIcon } from './TransactionIcon'; + +const meta: Meta = { + component: TransactionIcon, + title: 'History/TransactionIcon', + args: { + type: 'yield', + }, +}; + +export default meta; + +export const Yield: StoryObj = {}; + +export const SmallScreen: StoryObj = { + parameters: { + viewport: { + defaultViewport: 'mobile1', + }, + }, +}; + +export const Sent: StoryObj = { + args: { + type: 'sent', + }, +}; + +export const Received: StoryObj = { + args: { + type: 'received', + }, +}; + +export const Swap: StoryObj = { + args: { + type: 'swap', + tokenIcon: 'https://app.oeth.com/images/currency/reth-icon-small.png', + }, +}; diff --git a/libs/oeth/history/src/components/TransactionIcon.tsx b/libs/oeth/history/src/components/TransactionIcon.tsx new file mode 100644 index 000000000..29e0390e7 --- /dev/null +++ b/libs/oeth/history/src/components/TransactionIcon.tsx @@ -0,0 +1,68 @@ +import { Box } from '@mui/material'; +import React from 'react'; + +type Props = + | { + type: 'sent' | 'received' | 'yield'; + } + | { type: 'swap'; tokenIcon: string }; + +export function TransactionIcon(props: Props) { + return ( + + + + {props.type === 'swap' && ( + + + + )} + + ); +} diff --git a/libs/shared/assets/files/Received.svg b/libs/shared/assets/files/Received.svg new file mode 100644 index 000000000..a9664ed96 --- /dev/null +++ b/libs/shared/assets/files/Received.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libs/shared/assets/files/Send.svg b/libs/shared/assets/files/Send.svg new file mode 100644 index 000000000..34aca34c1 --- /dev/null +++ b/libs/shared/assets/files/Send.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libs/shared/assets/files/Swap.svg b/libs/shared/assets/files/Swap.svg new file mode 100644 index 000000000..4a9983d31 --- /dev/null +++ b/libs/shared/assets/files/Swap.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/libs/shared/assets/files/Yield.svg b/libs/shared/assets/files/Yield.svg new file mode 100644 index 000000000..9d3263cc2 --- /dev/null +++ b/libs/shared/assets/files/Yield.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +