-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Wave8] Create a Workspace Card #32339
Changes from all commits
d254e4f
fa86c13
957cab8
294bca6
79fbdb1
0f16ecf
2122277
8aea9bb
4526678
bf42670
d76eeef
74dc5cc
9146059
73721d1
7178306
04d59f3
3988d7f
cd85712
9da1c8e
5d3d93a
0cc848e
91b8e91
5e800a2
6fd3b5a
0ea0c16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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, | ||
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MaciejSWM would you mind working on #25024? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumped that issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed that here @aimane-chnaif, funny enough you where chosen for C+ review 😸 |
||
}; | ||
|
||
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; |
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have some dependency which is not migrated to TS or can we make this in TS now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe at the time of Section/index.js (originally Section.js) migration