-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enroll option for resource cards
- Loading branch information
1 parent
a0eb14c
commit 2aa9125
Showing
8 changed files
with
137 additions
and
79 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
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
50 changes: 50 additions & 0 deletions
50
web/packages/teleport/src/Integrations/status/AwsOidc/EnrollCard.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,50 @@ | ||
import { useHistory } from 'react-router'; | ||
import styled from 'styled-components'; | ||
|
||
import { ButtonBorder, Card, Flex, H2, ResourceIcon } from 'design'; | ||
|
||
import cfg from 'teleport/config'; | ||
import { AwsResource } from 'teleport/Integrations/status/AwsOidc/StatCard'; | ||
|
||
type EnrollCardProps = { | ||
resource: AwsResource; | ||
}; | ||
|
||
export function EnrollCard({ resource }: EnrollCardProps) { | ||
const history = useHistory(); | ||
|
||
const handleClick = () => { | ||
history.push({ | ||
pathname: cfg.routes.discover, | ||
state: { searchKeywords: resource }, | ||
}); | ||
}; | ||
|
||
// todo (michellescripts) update enroll design once ready | ||
return ( | ||
<Enroll> | ||
<Flex flexDirection="column" gap={4}> | ||
<Flex alignItems="center" mb={2}> | ||
<ResourceIcon name={resource} mr={2} width="32px" height="32px" /> | ||
<H2>{resource.toUpperCase()}</H2> | ||
</Flex> | ||
<ButtonBorder size="large" onClick={handleClick}> | ||
Enroll {resource.toUpperCase()} | ||
</ButtonBorder> | ||
</Flex> | ||
</Enroll> | ||
); | ||
} | ||
|
||
const Enroll = styled(Card)` | ||
width: 33%; | ||
background-color: ${props => props.theme.colors.levels.surface}; | ||
padding: 12px; | ||
border-radius: ${props => props.theme.radii[2]}px; | ||
border: ${props => `1px solid ${props.theme.colors.levels.surface}`}; | ||
&:hover { | ||
background-color: ${props => props.theme.colors.levels.elevated}; | ||
box-shadow: ${({ theme }) => theme.boxShadow[2]}; | ||
} | ||
`; |
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
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