Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Changes #2084

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'

function GridRows(props) {

const {columns , items, CardComponent, buttonText, onButtonClick, changedColumns} = props;
const {columns , items, CardComponent, buttonText, onButtonClick, changedColumns, currentSelected} = props;
let usedColumns = changedColumns && changedColumns > 0 ? changedColumns : columns

const rows = Math.ceil((items?.length)/usedColumns)
Expand All @@ -18,7 +18,7 @@ function GridRows(props) {
const itemIndex = index * usedColumns + col;
const item = items[itemIndex];
if (item) {
return <CardComponent cardObj={item} buttonText={buttonText} key={itemIndex} onButtonClick={onButtonClick}/>;
return <CardComponent currentSelected={currentSelected} cardObj={item} buttonText={buttonText} key={itemIndex} onButtonClick={onButtonClick}/>;
}
})}
</HorizontalGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,10 @@
background-color: #E4E5E7;
color: #202223 !important;
font-weight: 550 !important;
}

.selected-card {
border-radius: 8px;
border: 1px solid #8C9196 !important;
box-shadow: var(--p-shadow-base) !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Avatar, Button, Card, Text, VerticalStack, HorizontalStack, Badge, Box

function RowCard(props) {

const {cardObj, onButtonClick, buttonText} = props ;
const {cardObj, onButtonClick, buttonText, currentSelected} = props ;
const goToDocs = () => {
window.open(cardObj.docsUrl)
}
Expand All @@ -12,28 +12,30 @@ function RowCard(props) {
}

return (
<Card>
<VerticalStack gap="5">
<div style={{display: 'flex' , justifyContent: 'space-between'}}>
<Box padding={"2"} borderWidth='1' borderColor='border-subdued' borderRadius='2'>
<Avatar customer size="extraSmall" name={cardObj.label} source={cardObj.icon} shape='square'/>
</Box>
<Box paddingBlockStart="1">
{cardObj.badge ? <Badge size='small' status='info'>{cardObj.badge}</Badge> : null}
</Box>
</div>
<VerticalStack gap="1">
<Text variant="headingMd" as="h5">{cardObj.label}</Text>
<Box minHeight="80px">
<Text variant="bodyMd" color='subdued'>{cardObj.text}</Text>
</Box>
<div className={`${currentSelected === cardObj.label ? 'selected-card' : ''}`}>
<Card>
<VerticalStack gap="5">
<div style={{display: 'flex' , justifyContent: 'space-between'}}>
<Box padding={"2"} borderWidth='1' borderColor='border-subdued' borderRadius='2'>
<Avatar customer size="extraSmall" name={cardObj.label} source={cardObj.icon} shape='square'/>
</Box>
<Box paddingBlockStart="1">
{cardObj.badge ? <Badge size='small' status='info'>{cardObj.badge}</Badge> : null}
</Box>
</div>
<VerticalStack gap="1">
<Text variant="headingMd" as="h5">{cardObj.label}</Text>
<Box minHeight="80px">
<Text variant="bodyMd" color='subdued'>{cardObj.text}</Text>
</Box>
</VerticalStack>
<HorizontalStack gap={"4"} align='start'>
<Button onClick={handleAction}>{buttonText}</Button>
<Button plain onClick={goToDocs} size='medium'>See Docs</Button>
</HorizontalStack>
</VerticalStack>
<HorizontalStack gap={"4"} align='start'>
<Button onClick={handleAction}>{buttonText}</Button>
<Button plain onClick={goToDocs} size='medium'>See Docs</Button>
</HorizontalStack>
</VerticalStack>
</Card>
</Card>
</div>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function UpdateConnections(props) {
<Divider/>
<GridRows CardComponent={RowCard} columns="3"
items={obj[key]} buttonText="Connect" onButtonClick={onButtonClick}
changedColumns={newCol}
changedColumns={newCol} currentSelected={currentCardObj?.label || ""}
/>
</VerticalStack>
)
Expand Down
Loading