-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32339 from software-mansion-labs/wave8/create-a-w…
…orkspace-card [Wave8] Create a Workspace Card
- Loading branch information
Showing
10 changed files
with
127 additions
and
30 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
assets/images/simple-illustrations/simple-illustration__hotdogstand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Icon from '@components/Icon'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
const iconSectionPropTypes = { | ||
icon: PropTypes.icon, | ||
IconComponent: PropTypes.IconComponent, | ||
iconContainerStyles: PropTypes.iconContainerStyles, | ||
}; | ||
|
||
const defaultIconSectionPropTypes = { | ||
icon: null, | ||
IconComponent: null, | ||
iconContainerStyles: [], | ||
}; | ||
|
||
function IconSection({icon, IconComponent, iconContainerStyles}) { | ||
const styles = useThemeStyles(); | ||
|
||
return ( | ||
<View style={[styles.flexGrow1, styles.flexRow, styles.justifyContentEnd, ...iconContainerStyles]}> | ||
{Boolean(icon) && ( | ||
<Icon | ||
src={icon} | ||
height={68} | ||
width={68} | ||
/> | ||
)} | ||
{Boolean(IconComponent) && <IconComponent />} | ||
</View> | ||
); | ||
} | ||
|
||
IconSection.displayName = 'IconSection'; | ||
IconSection.propTypes = iconSectionPropTypes; | ||
IconSection.defaultProps = defaultIconSectionPropTypes; | ||
|
||
export default IconSection; |
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
33 changes: 33 additions & 0 deletions
33
src/pages/workspace/card/WorkspaceCardCreateAWorkspace.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,33 @@ | ||
import React from 'react'; | ||
import Button from '@components/Button'; | ||
import * as Illustrations from '@components/Icon/Illustrations'; | ||
import Section, {CARD_LAYOUT} from '@components/Section'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
function WorkspaceCardCreateAWorkspace() { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<Section | ||
title={translate('workspace.emptyWorkspace.title')} | ||
icon={Illustrations.HotDogStand} | ||
cardLayout={CARD_LAYOUT.ICON_ON_TOP} | ||
subtitle={translate('workspace.emptyWorkspace.subtitle')} | ||
subtitleMuted | ||
containerStyles={[styles.highlightBG]} | ||
> | ||
<Button | ||
text={translate('workspace.emptyWorkspace.createAWorkspaceCTA')} | ||
style={styles.mt5} | ||
success | ||
medium | ||
/> | ||
</Section> | ||
); | ||
} | ||
|
||
WorkspaceCardCreateAWorkspace.displayName = 'WorkspaceCardNoVBAView'; | ||
|
||
export default WorkspaceCardCreateAWorkspace; |
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