Design fixes (#422)
This commit is contained in:
@ -49,7 +49,7 @@ type FilterOperandRelationType<WhereType extends FilterWhereType> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type FilterOperandFieldType = {
|
type FilterOperandFieldType = {
|
||||||
label: 'Contains' | 'Does not contain' | 'Greater than' | 'Less than';
|
label: 'Contains' | "Doesn't contain" | 'Greater than' | 'Less than';
|
||||||
id: 'like' | 'not_like' | 'greater_than' | 'less_than';
|
id: 'like' | 'not_like' | 'greater_than' | 'less_than';
|
||||||
whereTemplate: (value: string) => any;
|
whereTemplate: (value: string) => any;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
export const DropdownMenuSeparator = styled.div`
|
export const DropdownMenuSeparator = styled.div`
|
||||||
background-color: ${(props) => props.theme.mediumBorder};
|
background-color: ${(props) => props.theme.lightBorder};
|
||||||
height: 1px;
|
height: 1px;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -102,13 +102,13 @@ const StyledDropdownItemClipped = styled.span`
|
|||||||
|
|
||||||
const StyledDropdownTopOption = styled.li`
|
const StyledDropdownTopOption = styled.li`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid ${(props) => props.theme.primaryBorder};
|
border-bottom: 1px solid ${(props) => props.theme.lightBorder};
|
||||||
color: ${(props) => props.theme.text80};
|
color: ${(props) => props.theme.text80};
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
font-weight: ${(props) => props.theme.fontWeightMedium};
|
font-weight: ${(props) => props.theme.fontWeightMedium};
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: calc(${(props) => props.theme.spacing(2)} + 2px)
|
padding: calc(${(props) => props.theme.spacing(2)})
|
||||||
calc(${(props) => props.theme.spacing(2)});
|
calc(${(props) => props.theme.spacing(2)});
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@ -191,13 +191,17 @@ function DropdownButton({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const StyleAngleDownContainer = styled.div`
|
const StyleAngleDownContainer = styled.div`
|
||||||
|
color: ${(props) => props.theme.text40};
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function DropdownTopOptionAngleDown() {
|
function DropdownTopOptionAngleDown() {
|
||||||
return (
|
return (
|
||||||
<StyleAngleDownContainer>
|
<StyleAngleDownContainer>
|
||||||
<IconChevronDown />
|
<IconChevronDown size={16} />
|
||||||
</StyleAngleDownContainer>
|
</StyleAngleDownContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,8 +114,6 @@ export const FilterDropdownButton = <TData extends FilterableFieldsType>({
|
|||||||
result.value.id === selectedEntityId
|
result.value.id === selectedEntityId
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log({ result });
|
|
||||||
|
|
||||||
if (resultIsEntity(result.value)) {
|
if (resultIsEntity(result.value)) {
|
||||||
setSelectedEntityId(result.value.id);
|
setSelectedEntityId(result.value.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,4 +14,8 @@ export const commonText = {
|
|||||||
|
|
||||||
iconSizeMedium: 16,
|
iconSizeMedium: 16,
|
||||||
iconSizeSmall: 14,
|
iconSizeSmall: 14,
|
||||||
|
|
||||||
|
iconStrikeLight: 1.6,
|
||||||
|
iconStrikeMedium: 2,
|
||||||
|
iconStrikeBold: 2.5,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,12 +8,18 @@ import {
|
|||||||
IconUser,
|
IconUser,
|
||||||
IconUsers,
|
IconUsers,
|
||||||
} from '@/ui/icons/index';
|
} from '@/ui/icons/index';
|
||||||
|
import { commonText } from '@/ui/layout/styles/texts';
|
||||||
import { QueryMode, User } from '~/generated/graphql';
|
import { QueryMode, User } from '~/generated/graphql';
|
||||||
|
|
||||||
export const nameFilter = {
|
export const nameFilter = {
|
||||||
key: 'name',
|
key: 'name',
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
icon: <IconBuildingSkyscraper size={16} />,
|
icon: (
|
||||||
|
<IconBuildingSkyscraper
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -24,7 +30,7 @@ export const nameFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -43,7 +49,12 @@ export const nameFilter = {
|
|||||||
export const employeesFilter = {
|
export const employeesFilter = {
|
||||||
key: 'employees',
|
key: 'employees',
|
||||||
label: 'Employees',
|
label: 'Employees',
|
||||||
icon: <IconUsers size={16} />,
|
icon: (
|
||||||
|
<IconUsers
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -70,7 +81,12 @@ export const employeesFilter = {
|
|||||||
export const urlFilter = {
|
export const urlFilter = {
|
||||||
key: 'domainName',
|
key: 'domainName',
|
||||||
label: 'Url',
|
label: 'Url',
|
||||||
icon: <IconLink size={16} />,
|
icon: (
|
||||||
|
<IconLink
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -84,7 +100,7 @@ export const urlFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -103,7 +119,12 @@ export const urlFilter = {
|
|||||||
export const addressFilter = {
|
export const addressFilter = {
|
||||||
key: 'address',
|
key: 'address',
|
||||||
label: 'Address',
|
label: 'Address',
|
||||||
icon: <IconMap size={16} />,
|
icon: (
|
||||||
|
<IconMap
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -114,7 +135,7 @@ export const addressFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -133,7 +154,12 @@ export const addressFilter = {
|
|||||||
export const ccreatedAtFilter = {
|
export const ccreatedAtFilter = {
|
||||||
key: 'createdAt',
|
key: 'createdAt',
|
||||||
label: 'Created At',
|
label: 'Created At',
|
||||||
icon: <IconCalendarEvent size={16} />,
|
icon: (
|
||||||
|
<IconCalendarEvent
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'date',
|
type: 'date',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -160,7 +186,12 @@ export const ccreatedAtFilter = {
|
|||||||
export const accountOwnerFilter = {
|
export const accountOwnerFilter = {
|
||||||
key: 'accountOwner',
|
key: 'accountOwner',
|
||||||
label: 'Account Owner',
|
label: 'Account Owner',
|
||||||
icon: <IconUser size={16} />,
|
icon: (
|
||||||
|
<IconUser
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
searchConfig: {
|
searchConfig: {
|
||||||
query: SEARCH_USER_QUERY,
|
query: SEARCH_USER_QUERY,
|
||||||
|
|||||||
@ -8,12 +8,18 @@ import {
|
|||||||
IconPhone,
|
IconPhone,
|
||||||
IconUser,
|
IconUser,
|
||||||
} from '@/ui/icons/index';
|
} from '@/ui/icons/index';
|
||||||
|
import { commonText } from '@/ui/layout/styles/texts';
|
||||||
import { Company, QueryMode } from '~/generated/graphql';
|
import { Company, QueryMode } from '~/generated/graphql';
|
||||||
|
|
||||||
export const fullnameFilter = {
|
export const fullnameFilter = {
|
||||||
key: 'fullname',
|
key: 'fullname',
|
||||||
label: 'People',
|
label: 'People',
|
||||||
icon: <IconUser size={16} />,
|
icon: (
|
||||||
|
<IconUser
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -37,7 +43,7 @@ export const fullnameFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -66,7 +72,12 @@ export const fullnameFilter = {
|
|||||||
export const emailFilter = {
|
export const emailFilter = {
|
||||||
key: 'email',
|
key: 'email',
|
||||||
label: 'Email',
|
label: 'Email',
|
||||||
icon: <IconMail size={16} />,
|
icon: (
|
||||||
|
<IconMail
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -77,7 +88,7 @@ export const emailFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -96,7 +107,12 @@ export const emailFilter = {
|
|||||||
export const companyFilter = {
|
export const companyFilter = {
|
||||||
key: 'company_name',
|
key: 'company_name',
|
||||||
label: 'Company',
|
label: 'Company',
|
||||||
icon: <IconBuildingSkyscraper size={16} />,
|
icon: (
|
||||||
|
<IconBuildingSkyscraper
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
searchConfig: {
|
searchConfig: {
|
||||||
query: SEARCH_COMPANY_QUERY,
|
query: SEARCH_COMPANY_QUERY,
|
||||||
@ -140,7 +156,12 @@ export const companyFilter = {
|
|||||||
export const phoneFilter = {
|
export const phoneFilter = {
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
label: 'Phone',
|
label: 'Phone',
|
||||||
icon: <IconPhone size={16} />,
|
icon: (
|
||||||
|
<IconPhone
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -151,7 +172,7 @@ export const phoneFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
@ -170,7 +191,12 @@ export const phoneFilter = {
|
|||||||
export const createdAtFilter = {
|
export const createdAtFilter = {
|
||||||
key: 'createdAt',
|
key: 'createdAt',
|
||||||
label: 'Created At',
|
label: 'Created At',
|
||||||
icon: <IconCalendarEvent size={16} />,
|
icon: (
|
||||||
|
<IconCalendarEvent
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'date',
|
type: 'date',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -197,7 +223,12 @@ export const createdAtFilter = {
|
|||||||
export const cityFilter = {
|
export const cityFilter = {
|
||||||
key: 'city',
|
key: 'city',
|
||||||
label: 'City',
|
label: 'City',
|
||||||
icon: <IconMap size={16} />,
|
icon: (
|
||||||
|
<IconMap
|
||||||
|
size={commonText.iconSizeMedium}
|
||||||
|
stroke={commonText.iconStrikeLight}
|
||||||
|
/>
|
||||||
|
),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
operands: [
|
operands: [
|
||||||
{
|
{
|
||||||
@ -208,7 +239,7 @@ export const cityFilter = {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Does not contain',
|
label: "Doesn't contain",
|
||||||
id: 'not_like',
|
id: 'not_like',
|
||||||
whereTemplate: (searchString: string) => ({
|
whereTemplate: (searchString: string) => ({
|
||||||
NOT: [
|
NOT: [
|
||||||
|
|||||||
Reference in New Issue
Block a user