-
Notifications
You must be signed in to change notification settings - Fork 57
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
13 changed files
with
2,483 additions
and
212 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
37 changes: 37 additions & 0 deletions
37
src/components/settings/integrations/NetsuiteIntegrationItemHeader.tsx
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,37 @@ | ||
import styled from 'styled-components' | ||
|
||
import { Typography } from '~/components/designSystem' | ||
import { useInternationalization } from '~/hooks/core/useInternationalization' | ||
import { HEADER_TABLE_HEIGHT, theme } from '~/styles' | ||
|
||
type TNetsuiteIntegrationItemHeaderProps = { | ||
columnName: string | ||
} | ||
|
||
const NetsuiteIntegrationItemHeader = ({ columnName }: TNetsuiteIntegrationItemHeaderProps) => { | ||
const { translate } = useInternationalization() | ||
|
||
return ( | ||
<ItemHeader> | ||
<Typography variant="bodyHl" color="grey500"> | ||
{columnName} | ||
</Typography> | ||
<Typography variant="bodyHl" color="grey500"> | ||
{translate('text_6630e3210c13c500cd398e97')} | ||
</Typography> | ||
</ItemHeader> | ||
) | ||
} | ||
|
||
export default NetsuiteIntegrationItemHeader | ||
|
||
const ItemHeader = styled.div` | ||
height: ${HEADER_TABLE_HEIGHT}px; | ||
padding: 0 ${theme.spacing(12)}; | ||
box-sizing: border-box; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
box-shadow: ${theme.shadows[7]}; | ||
background-color: ${theme.palette.grey[100]}; | ||
` |
127 changes: 127 additions & 0 deletions
127
src/components/settings/integrations/NetsuiteIntegrationItemLine.tsx
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,127 @@ | ||
import { Stack } from '@mui/material' | ||
import styled from 'styled-components' | ||
|
||
import { Avatar, Icon, IconName, Skeleton, Typography } from '~/components/designSystem' | ||
import { useInternationalization } from '~/hooks/core/useInternationalization' | ||
import { NAV_HEIGHT, theme } from '~/styles' | ||
|
||
const STATUS_SIZE = 12 | ||
|
||
type TNetsuiteIntegrationItemLineProps = { | ||
description: string | ||
icon: IconName | ||
label: string | ||
loading: boolean | ||
mappingInfos?: { | ||
id: string | ||
name: string | ||
} | ||
onMappingClick?: () => void | ||
} | ||
|
||
const NetsuiteIntegrationItemLine = ({ | ||
description, | ||
icon, | ||
label, | ||
loading, | ||
mappingInfos, | ||
onMappingClick, | ||
}: TNetsuiteIntegrationItemLineProps) => { | ||
const { translate } = useInternationalization() | ||
|
||
if (loading) { | ||
return ( | ||
<SkeletonWrapper> | ||
<Stack direction="row" alignItems="center" gap={3} sx={{ flex: 1 }}> | ||
<Skeleton variant="connectorAvatar" size="big" /> | ||
<Stack sx={{ flex: 1 }}> | ||
<Skeleton variant="text" width={180} height={12} marginBottom={10} /> | ||
<Skeleton variant="text" width={80} height={12} /> | ||
</Stack> | ||
</Stack> | ||
|
||
<Skeleton variant="text" width={200} height={26} /> | ||
</SkeletonWrapper> | ||
) | ||
} | ||
|
||
return ( | ||
<ItemLine onClick={onMappingClick}> | ||
<Stack direction="row" alignItems="center" gap={3}> | ||
<Avatar size="big" variant="connector"> | ||
<Icon name={icon} color="dark" /> | ||
</Avatar> | ||
|
||
<Stack> | ||
<Typography variant="bodyHl" color="grey700"> | ||
{label} | ||
</Typography> | ||
<Typography variant="caption" color="grey600"> | ||
{description} | ||
</Typography> | ||
</Stack> | ||
</Stack> | ||
|
||
<StatusContainer> | ||
<svg height={STATUS_SIZE} width={STATUS_SIZE}> | ||
<circle | ||
cx="6" | ||
cy="6" | ||
r="6" | ||
fill={!!mappingInfos ? theme.palette.success[600] : theme.palette.error[600]} | ||
/> | ||
</svg> | ||
|
||
<Typography variant="captionHl" color="grey700"> | ||
{!!mappingInfos | ||
? `${mappingInfos.name} (${mappingInfos.id})` | ||
: translate('text_6630e3210c13c500cd398e9a')} | ||
</Typography> | ||
</StatusContainer> | ||
</ItemLine> | ||
) | ||
} | ||
|
||
export default NetsuiteIntegrationItemLine | ||
|
||
const ItemLine = styled.div` | ||
min-height: ${NAV_HEIGHT}px; | ||
padding: ${theme.spacing(3)} ${theme.spacing(12)}; | ||
box-sizing: border-box; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
box-shadow: ${theme.shadows[7]}; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: ${theme.palette.grey[100]}; | ||
} | ||
` | ||
|
||
const SkeletonWrapper = styled.div` | ||
height: ${NAV_HEIGHT}px; | ||
padding: ${theme.spacing(3)} ${theme.spacing(12)}; | ||
box-sizing: border-box; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
box-shadow: ${theme.shadows[7]}; | ||
` | ||
|
||
const StatusContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
background-color: ${theme.palette.grey[100]}; | ||
padding: ${theme.spacing(1)} ${theme.spacing(2)}; | ||
box-sizing: border-box; | ||
border-radius: ${theme.shape.borderRadius}px; | ||
min-height: ${theme.spacing(8)}; | ||
gap: ${theme.spacing(2)}; | ||
outline: 1px solid ${theme.palette.grey[300]}; | ||
outline-offset: -1px; | ||
svg { | ||
flex-shrink: 0; | ||
} | ||
` |
13 changes: 0 additions & 13 deletions
13
src/components/settings/integrations/NetsuiteIntegrationItems.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.