-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,697 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
export interface PartnerDataType { | ||
id?: number | ||
attributes?: AttributesType | ||
} | ||
|
||
export interface AttributesType { | ||
contactEmail?: string | ||
companyName?: string | ||
companyCountry?: string | ||
companyWebsite?: string | ||
contactFirstname?: string | ||
contactLastname?: string | ||
contactPhone?: string | ||
companyShortDescription?: string | ||
companyLongDescription?: string | ||
isConsortiumMember?: boolean | ||
createdAt?: string | ||
updatedAt?: string | ||
publishedAt?: string | ||
logoBox?: string | ||
companyLinkedin?: string | ||
companyTwitter?: string | ||
companyLogoColor?: CompanyLogoColorType | ||
business_fields?: BusinessFieldsType | ||
company_size?: CompanySizeType | ||
companyLogoDark?: CompanyLogoDarkType | ||
companyLogoLight?: CompanyLogoLightType | ||
country_flag?: CountryFlagType | ||
} | ||
|
||
export interface CompanyLogoColorType { | ||
data?: LogoDataType | ||
} | ||
|
||
export interface LogoDataType { | ||
id?: number | ||
attributes?: LogoAttributesType | ||
} | ||
|
||
export interface LogoAttributesType { | ||
name?: string | ||
alternativeText?: string | ||
caption?: string | ||
width?: number | ||
height?: number | ||
formats?: FormatsType | ||
hash?: string | ||
ext?: string | ||
mime?: string | ||
size?: number | ||
url?: string | ||
previewUrl?: string | ||
provider?: string | ||
provider_metadata?: string | ||
createdAt?: string | ||
updatedAt?: string | ||
} | ||
|
||
export interface FormatsType { | ||
large?: FormatDetailType | ||
small?: FormatDetailType | ||
medium?: FormatDetailType | ||
thumbnail?: FormatDetailType | ||
} | ||
|
||
export interface FormatDetailType { | ||
ext?: string | ||
url?: string | ||
hash?: string | ||
mime?: string | ||
name?: string | ||
path?: string | ||
size?: number | ||
width?: number | ||
height?: number | ||
} | ||
|
||
export interface BusinessFieldsType { | ||
data?: BusinessFieldType[] | ||
} | ||
|
||
export interface BusinessFieldType { | ||
id?: number | ||
attributes?: BusinessFieldAttributesType | ||
} | ||
|
||
export interface BusinessFieldAttributesType { | ||
BusinessField?: string | ||
createdAt?: string | ||
updatedAt?: string | ||
} | ||
|
||
export interface CompanySizeType { | ||
data?: CompanySizeDataType | ||
} | ||
|
||
export interface CompanySizeDataType { | ||
id?: number | ||
attributes?: CompanySizeAttributesType | ||
} | ||
|
||
export interface CompanySizeAttributesType { | ||
companyNumberOfEmployees?: string | ||
createdAt?: string | ||
updatedAt?: string | ||
publishedAt?: string | ||
} | ||
|
||
export interface CompanyLogoDarkType { | ||
data?: LogoDataType | ||
} | ||
|
||
export interface CompanyLogoLightType { | ||
data?: LogoDataType | ||
} | ||
|
||
export interface CountryFlagType { | ||
data?: CountryFlagDataType | ||
} | ||
|
||
export interface CountryFlagDataType { | ||
id?: number | ||
attributes?: CountryFlagAttributesType | ||
} | ||
|
||
export interface CountryFlagAttributesType { | ||
countryIdentifier?: string | ||
countryName?: string | ||
createdAt?: string | ||
updatedAt?: string | ||
publishedAt?: string | ||
} | ||
|
||
export interface PartnersResponseType { | ||
data?: PartnerDataType[] | ||
meta?: MetaType | ||
} | ||
|
||
export interface MetaType { | ||
pagination?: PaginationType | ||
} | ||
|
||
export interface PaginationType { | ||
page: number | ||
pageSize: number | ||
pageCount: number | ||
total: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react' | ||
|
||
import { mdiCheckCircle } from '@mdi/js' | ||
import Icon from '@mdi/react' | ||
import { Typography } from '@mui/material' | ||
import ListItemText from '@mui/material/ListItemText' | ||
import MenuItem from '@mui/material/MenuItem' | ||
import Select, { SelectChangeEvent } from '@mui/material/Select' | ||
import { ActionType, StatePartnersType, partnersActions } from '../../helpers/partnersReducer' | ||
interface BusinessFieldFilterProps { | ||
state: StatePartnersType | ||
dispatchPartnersActions: React.Dispatch<ActionType> | ||
} | ||
|
||
const BusinessFieldFilter: React.FC<BusinessFieldFilterProps> = ({ | ||
state, | ||
dispatchPartnersActions, | ||
}) => { | ||
const handleChange = (event: SelectChangeEvent<typeof state.businessField>) => { | ||
const { | ||
target: { value }, | ||
} = event | ||
dispatchPartnersActions({ type: partnersActions.UPDATE_BUSINESS_FIELD, payload: value[1] }) | ||
} | ||
|
||
return ( | ||
<Select | ||
multiple | ||
value={['default']} | ||
onChange={handleChange} | ||
sx={{ | ||
flex: '1 1 400px', | ||
padding: '0', | ||
maxWidth: '400px', | ||
borderRadius: '12px', | ||
color: theme => theme.palette.text.primary, | ||
'.MuiSelect-select ': { | ||
boxSizing: 'border-box', | ||
height: '40px', | ||
padding: '10px 16px 10px 16px', | ||
borderRadius: '12px', | ||
display: 'flex', | ||
alignItems: 'center', | ||
border: theme => `solid 2px ${theme.palette.card.border}`, | ||
}, | ||
'.MuiOutlinedInput-notchedOutline': { | ||
border: 'none !important', | ||
}, | ||
'& [aria-expanded=true]': { | ||
background: theme => theme.palette.grey[600], | ||
boxSizing: 'border-box', | ||
height: '40px', | ||
}, | ||
}} | ||
renderValue={() => <Typography variant="body1">Business fields</Typography>} | ||
MenuProps={{ | ||
PaperProps: { | ||
style: { | ||
maxHeight: '400px', | ||
overflow: 'auto', | ||
}, | ||
}, | ||
}} | ||
> | ||
<MenuItem sx={{ display: 'none' }} value={'default'}> | ||
<Typography variant="body1">Business fields</Typography> | ||
</MenuItem> | ||
{state.businessField.map((businessField, index) => ( | ||
<MenuItem key={index} value={businessField.name}> | ||
<ListItemText | ||
sx={[{ color: !businessField.active ? '#CBD4E2' : '#ffffff' }]} | ||
primary={businessField.name} | ||
/> | ||
{businessField.active && <Icon path={mdiCheckCircle} size={1} />} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
) | ||
} | ||
|
||
export default BusinessFieldFilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Box, Chip } from '@mui/material' | ||
import React from 'react' | ||
|
||
type PartnerBusinessFieldsProps = { business_fields: any; isPartnerView?: boolean } | ||
|
||
const PartnerBusinessFields = ({ business_fields, isPartnerView }: PartnerBusinessFieldsProps) => { | ||
const content = | ||
business_fields.data.length <= 2 || isPartnerView ? ( | ||
business_fields.data.map((elem, key) => ( | ||
<Chip | ||
key={key} | ||
sx={{ | ||
backgroundColor: 'transparent', | ||
border: '1px solid', | ||
borderColor: theme => theme.palette.grey['700'], | ||
}} | ||
label={elem.attributes.BusinessField} | ||
/> | ||
)) | ||
) : ( | ||
<> | ||
<Chip | ||
sx={{ | ||
backgroundColor: 'transparent', | ||
border: '1px solid', | ||
borderColor: theme => theme.palette.grey['700'], | ||
}} | ||
label={business_fields.data[0].attributes.BusinessField} | ||
/> | ||
<Chip | ||
sx={{ | ||
backgroundColor: 'transparent', | ||
border: '1px solid', | ||
borderColor: theme => theme.palette.grey['700'], | ||
}} | ||
label={`+${business_fields.data.length - 1}`} | ||
/> | ||
</> | ||
) | ||
return ( | ||
<Box | ||
sx={{ | ||
whiteSpace: 'wrap', | ||
width: '100%', | ||
display: 'flex', | ||
gap: '0.4rem', | ||
alignItems: 'center', | ||
flexWrap: 'wrap', | ||
}} | ||
> | ||
{content} | ||
</Box> | ||
) | ||
} | ||
|
||
export default PartnerBusinessFields |
Oops, something went wrong.