Commit 4925c118 authored by tom's avatar tom

design updates

parent a1d394c3
...@@ -92,9 +92,9 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => { ...@@ -92,9 +92,9 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
Company info Company info
</GridItem> </GridItem>
<PublicTagsSubmitFieldRequesterName/> <PublicTagsSubmitFieldRequesterName/>
<PublicTagsSubmitFieldCompanyName/>
{ !isMobile && <div/> }
<PublicTagsSubmitFieldRequesterEmail/> <PublicTagsSubmitFieldRequesterEmail/>
{ !isMobile && <div/> }
<PublicTagsSubmitFieldCompanyName/>
<PublicTagsSubmitFieldCompanyWebsite/> <PublicTagsSubmitFieldCompanyWebsite/>
{ !isMobile && <div/> } { !isMobile && <div/> }
......
import { Alert, Box, Button, Grid, GridItem } from '@chakra-ui/react'; import { Alert, Box, Button, Flex, Grid, GridItem } from '@chakra-ui/react';
import _pickBy from 'lodash/pickBy'; import _pickBy from 'lodash/pickBy';
import React from 'react'; import React from 'react';
...@@ -66,12 +66,14 @@ const PublicTagsSubmitResult = ({ data }: Props) => { ...@@ -66,12 +66,14 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
<Box as="h2" textStyle="h4" mt={ 8 } mb={ 5 }>Public tags/labels</Box> <Box as="h2" textStyle="h4" mt={ 8 } mb={ 5 }>Public tags/labels</Box>
{ hasErrors ? <PublicTagsSubmitResultWithErrors data={ groupedData }/> : <PublicTagsSubmitResultSuccess data={ groupedData }/> } { hasErrors ? <PublicTagsSubmitResultWithErrors data={ groupedData }/> : <PublicTagsSubmitResultSuccess data={ groupedData }/> }
<Flex flexDir={{ base: 'column', lg: 'row' }} columnGap={ 6 } mt={ 8 } rowGap={ 3 }>
{ hasErrors && ( { hasErrors && (
<Button size="lg" variant="outline" mt={ 8 } mr={ 6 } as="a" href={ route({ pathname: '/public-tags/submit', query: startOverButtonQuery }) }> <Button size="lg" variant="outline" as="a" href={ route({ pathname: '/public-tags/submit', query: startOverButtonQuery }) }>
Start over Start over
</Button> </Button>
) } ) }
<Button size="lg" mt={ 8 } as="a" href={ route({ pathname: '/public-tags/submit' }) }>Add new tag</Button> <Button size="lg" as="a" href={ route({ pathname: '/public-tags/submit' }) }>Add new tag</Button>
</Flex>
</div> </div>
); );
}; };
......
import { chakra, Flex, FormControl, useColorModeValue } from '@chakra-ui/react'; import { chakra, Flex, FormControl, useColorModeValue } from '@chakra-ui/react';
import type { GroupBase, SelectComponentsConfig, SingleValueProps } from 'chakra-react-select'; import type { GroupBase, SelectComponentsConfig, SingleValueProps } from 'chakra-react-select';
import { chakraComponents } from 'chakra-react-select'; import { chakraComponents } from 'chakra-react-select';
import _capitalize from 'lodash/capitalize';
import React from 'react'; import React from 'react';
import type { ControllerRenderProps } from 'react-hook-form'; import type { ControllerRenderProps } from 'react-hook-form';
import { Controller, useFormContext } from 'react-hook-form'; import { Controller, useFormContext } from 'react-hook-form';
...@@ -28,7 +29,7 @@ const PublicTagsSubmitFieldTagType = ({ index, tagTypes, isDisabled }: Props) => ...@@ -28,7 +29,7 @@ const PublicTagsSubmitFieldTagType = ({ index, tagTypes, isDisabled }: Props) =>
const typeOptions = React.useMemo(() => tagTypes?.map((type) => ({ const typeOptions = React.useMemo(() => tagTypes?.map((type) => ({
value: type.type, value: type.type,
label: type.type, label: _capitalize(type.type),
})), [ tagTypes ]); })), [ tagTypes ]);
const fieldValue = watch(`tags.${ index }.type`).value; const fieldValue = watch(`tags.${ index }.type`).value;
...@@ -49,7 +50,11 @@ const PublicTagsSubmitFieldTagType = ({ index, tagTypes, isDisabled }: Props) => ...@@ -49,7 +50,11 @@ const PublicTagsSubmitFieldTagType = ({ index, tagTypes, isDisabled }: Props) =>
} }
case 'protocol': case 'protocol':
case 'generic': { case 'generic': {
return (<chakraComponents.SingleValue { ...props }><chakra.span color="gray.400">#</chakra.span> { children }</chakraComponents.SingleValue>); return (
<chakraComponents.SingleValue { ...props }>
<chakra.span color="gray.400">#</chakra.span> { children }
</chakraComponents.SingleValue>
);
} }
default: { default: {
......
...@@ -24,7 +24,7 @@ const PublicTagsSubmitFieldTags = ({ tagTypes }: Props) => { ...@@ -24,7 +24,7 @@ const PublicTagsSubmitFieldTags = ({ tagTypes }: Props) => {
const handleAddFieldClick = React.useCallback((index: number) => { const handleAddFieldClick = React.useCallback((index: number) => {
insert(index + 1, { insert(index + 1, {
name: '', name: '',
type: { label: 'name', value: 'name' }, type: { label: 'Name', value: 'name' },
url: undefined, url: undefined,
bgColor: undefined, bgColor: undefined,
textColor: undefined, textColor: undefined,
......
...@@ -3,7 +3,6 @@ import React from 'react'; ...@@ -3,7 +3,6 @@ import React from 'react';
import type { FormSubmitResultGrouped } from '../types'; import type { FormSubmitResultGrouped } from '../types';
import useIsMobile from 'lib/hooks/useIsMobile';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EntityTag from 'ui/shared/EntityTags/EntityTag'; import EntityTag from 'ui/shared/EntityTags/EntityTag';
...@@ -12,11 +11,9 @@ interface Props { ...@@ -12,11 +11,9 @@ interface Props {
} }
const PublicTagsSubmitResultSuccess = ({ data }: Props) => { const PublicTagsSubmitResultSuccess = ({ data }: Props) => {
const isMobile = useIsMobile();
return ( return (
<Grid gridTemplateColumns={{ base: '1fr', lg: '1fr 1fr' }} rowGap={ 3 } columnGap={ 3 }> <Grid gridTemplateColumns={{ base: '1fr', lg: '1fr 1fr' }} rowGap={ 3 } columnGap={ 3 }>
<GridItem> <GridItem overflow="hidden">
<Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Smart contract / Address (0x...)</Box> <Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Smart contract / Address (0x...)</Box>
<Flex flexDir="column" rowGap={ 2 } mt={ 2 }> <Flex flexDir="column" rowGap={ 2 } mt={ 2 }>
{ data.items { data.items
...@@ -27,7 +24,6 @@ const PublicTagsSubmitResultSuccess = ({ data }: Props) => { ...@@ -27,7 +24,6 @@ const PublicTagsSubmitResultSuccess = ({ data }: Props) => {
key={ hash } key={ hash }
address={{ hash }} address={{ hash }}
noIcon noIcon
truncation={ isMobile ? 'constant' : 'dynamic' }
/> />
)) } )) }
</Flex> </Flex>
......
...@@ -40,7 +40,7 @@ const PublicTagsSubmitResultWithErrors = ({ data }: Props) => { ...@@ -40,7 +40,7 @@ const PublicTagsSubmitResultWithErrors = ({ data }: Props) => {
borderRadius="base" borderRadius="base"
rowGap={ 3 } rowGap={ 3 }
> >
<GridItem px={ 6 } pt={ 4 } pb={{ base: 0, lg: 4 }}> <GridItem px={{ base: 4, lg: 6 }} pt={{ base: 2, lg: 4 }} pb={{ base: 0, lg: 4 }} overflow="hidden">
<Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Smart contract / Address (0x...)</Box> <Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Smart contract / Address (0x...)</Box>
<Flex flexDir="column" rowGap={ 2 } mt={ 2 }> <Flex flexDir="column" rowGap={ 2 } mt={ 2 }>
{ item.addresses.map((hash) => ( { item.addresses.map((hash) => (
...@@ -48,12 +48,11 @@ const PublicTagsSubmitResultWithErrors = ({ data }: Props) => { ...@@ -48,12 +48,11 @@ const PublicTagsSubmitResultWithErrors = ({ data }: Props) => {
key={ hash } key={ hash }
address={{ hash }} address={{ hash }}
noIcon noIcon
truncation={ isMobile ? 'constant' : 'dynamic' }
/> />
)) } )) }
</Flex> </Flex>
</GridItem> </GridItem>
<GridItem px={ 6 } pb={ 4 } pt={{ base: 0, lg: 4 }}> <GridItem px={{ base: 4, lg: 6 }} pb={{ base: 2, lg: 4 }} pt={{ base: 0, lg: 4 }}>
<Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Tag</Box> <Box fontSize="sm" color="text_secondary" fontWeight={ 500 }>Tag</Box>
<Flex rowGap={ 2 } columnGap={ 2 } mt={ 2 } justifyContent="flex-start" flexWrap="wrap"> <Flex rowGap={ 2 } columnGap={ 2 } mt={ 2 } justifyContent="flex-start" flexWrap="wrap">
{ item.tags.map((tag) => ( { item.tags.map((tag) => (
......
...@@ -105,7 +105,7 @@ export function getFormDefaultValues(query: Route['query'], userInfo: UserInfo | ...@@ -105,7 +105,7 @@ export function getFormDefaultValues(query: Route['query'], userInfo: UserInfo |
requesterEmail: getQueryParamString(query?.requesterEmail) || userInfo?.email || undefined, requesterEmail: getQueryParamString(query?.requesterEmail) || userInfo?.email || undefined,
companyName: getQueryParamString(query?.companyName), companyName: getQueryParamString(query?.companyName),
companyWebsite: getQueryParamString(query?.companyWebsite), companyWebsite: getQueryParamString(query?.companyWebsite),
tags: [ { name: '', type: { label: 'name', value: 'name' as const } } ], tags: [ { name: '', type: { label: 'Name', value: 'name' as const } } ],
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment