import { Col, Container, Row, StyleSystemThemedProps } from 'components/layout'; import { TouchableTile } from 'components/touchable-tile'; import { Text } from 'components/text'; import { ChevronRight, Community, Knowledge, Learn, Play, PlayDown, Star } from 'icons'; import { useSettings } from 'hooks'; import { Visible } from 'components/visible'; import { metrics } from 'config'; import { Divider } from 'components/divider'; const { STYLES } = metrics; const spaces = [ { id: 1, name: 'Community', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, subBlock: [ { id: 2, name: 'Community', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, }, { id: 4, name: 'Learn', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, }, { id: 5, name: 'Knowledge', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, }, ], }, { id: 7, name: 'Learn', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, subBlock: [], }, { id: 8, name: 'Knowledge', icon: , subTitle: 'PSY 345 Summer 2021-22', favorite: true, subBlock: [], }, ]; const isSpaceExpanded = (is: boolean) => { return is ? : ; }; export const AllSpace: React.FC = ({ ...props }) => { const { isSideBarCollapsed } = useSettings(); const mt = isSideBarCollapsed ? undefined : 'xs'; const alignItems = isSideBarCollapsed ? 'center' : undefined; return ( ALL SPACES {spaces.map((space) => ( {}} variant="text" title={space.name} leftElement={ <> {isSpaceExpanded(space.subBlock.length > 0)} } caption={space.subTitle} rightElement={} sizeVariant="medium" /> {space.subBlock.map((spaceItem) => ( {}} variant="text" title={spaceItem.name} leftElement={ <> } caption={space.subTitle} rightElement={} sizeVariant="medium" /> ))} ))} {}} variant="text" title="View All" centerElement={ View All } titleColor="caption-01" sizeVariant="small" /> ); }; type AllSpaceType = StyleSystemThemedProps & {};