diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index f877380..62f959e 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -9,3 +9,4 @@ export * from './nfa-card'; export * from './nfa-preview'; export * from './card-tag'; export * from './resolved-address'; +export * from './row-data'; diff --git a/ui/src/components/row-data/index.ts b/ui/src/components/row-data/index.ts new file mode 100644 index 0000000..e6e16df --- /dev/null +++ b/ui/src/components/row-data/index.ts @@ -0,0 +1 @@ +export * from './row-data'; diff --git a/ui/src/components/row-data/row-data.styles.ts b/ui/src/components/row-data/row-data.styles.ts new file mode 100644 index 0000000..0a46dc3 --- /dev/null +++ b/ui/src/components/row-data/row-data.styles.ts @@ -0,0 +1,26 @@ +import { Flex, Text } from '@/components'; +import { styled } from '@/theme'; + +import { IconStyles } from '../core/icon/icon.styles'; + +export const RowDataStyles = { + Container: styled(Flex, { + justifyContent: 'space-between', + }), + Text: { + Container: styled(Flex, { + alignItems: 'center', + maxWidth: '60%', + gap: '$2', + + [`${IconStyles.Container}`]: { + fontSize: '$2xl', + }, + }), + Label: styled(Text, { + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + overflow: 'hidden', + }), + }, +}; diff --git a/ui/src/components/row-data/row-data.tsx b/ui/src/components/row-data/row-data.tsx new file mode 100644 index 0000000..bc8c660 --- /dev/null +++ b/ui/src/components/row-data/row-data.tsx @@ -0,0 +1,25 @@ +import { forwardStyledRef } from '@/theme'; + +import { RowDataStyles as S } from './row-data.styles'; + +type RowDataProps = { + leftIcon: React.ReactNode; + label: string; + rightComponent: React.ReactNode; +}; + +export const RowData = forwardStyledRef( + ({ leftIcon, label, rightComponent, ...props }, ref) => { + return ( + + + {leftIcon} + {label} + + {rightComponent} + + ); + } +); + +RowData.displayName = 'RowData'; diff --git a/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx b/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx index a632748..9cdd56f 100644 --- a/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx +++ b/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx @@ -9,6 +9,7 @@ import { CardTag, Flex, Form, + RowData, Spinner, Stepper, Text, @@ -26,25 +27,11 @@ export const SelectedNFA: React.FC = () => { const { nfa } = CreateAccessPoint.useContext(); return ( - - - - - {nfa.name} - - - Selected NFA - + } + label={nfa.name} + rightComponent={Selected NFA} + /> ); }; diff --git a/ui/src/views/access-point/nfa-icon/nfa-icon.styles.ts b/ui/src/views/access-point/nfa-icon/nfa-icon.styles.ts index 39e91c7..50480f3 100644 --- a/ui/src/views/access-point/nfa-icon/nfa-icon.styles.ts +++ b/ui/src/views/access-point/nfa-icon/nfa-icon.styles.ts @@ -6,7 +6,6 @@ export const NFAIconStyles = { borderRadius: '$full', width: '$7', height: '$7', - mr: '$2', }), Image: styled('img', { width: '100%', diff --git a/ui/src/views/mint/github-step/steps/github-repo-configuration/repo-configuration-body/repo-configuration-body.tsx b/ui/src/views/mint/github-step/steps/github-repo-configuration/repo-configuration-body/repo-configuration-body.tsx index 26569a9..5971561 100644 --- a/ui/src/views/mint/github-step/steps/github-repo-configuration/repo-configuration-body/repo-configuration-body.tsx +++ b/ui/src/views/mint/github-step/steps/github-repo-configuration/repo-configuration-body/repo-configuration-body.tsx @@ -1,8 +1,15 @@ -import { Button, Card, CardTag, Flex, Stepper } from '@/components'; +import { + Button, + Card, + CardTag, + Flex, + Icon, + RowData, + Stepper, +} from '@/components'; import { Mint } from '@/views/mint/mint.context'; import { useMintFormContext } from '@/views/mint/nfa-step/form-step'; -import { RepoRow } from '../../repository-row'; import { RepoBranchCommitFields } from './repo-branch-commit-fields'; export const RepoConfigurationBody: React.FC = () => { @@ -21,12 +28,13 @@ export const RepoConfigurationBody: React.FC = () => { }; return ( - + - Use for NFA} + } + label={repositoryName?.name || ''} + css={{ cursor: 'default' }} + rightComponent={Use for NFA} />