diff --git a/packages/client/components/ActivityLibrary/ActivityCardFavorite.tsx b/packages/client/components/ActivityLibrary/ActivityCardFavorite.tsx new file mode 100644 index 00000000000..1a703d338f3 --- /dev/null +++ b/packages/client/components/ActivityLibrary/ActivityCardFavorite.tsx @@ -0,0 +1,46 @@ +import {Favorite} from '@mui/icons-material' +import clsx from 'clsx' +import React, {useState} from 'react' +import {Tooltip} from '../../ui/Tooltip/Tooltip' +import {TooltipContent} from '../../ui/Tooltip/TooltipContent' +import {TooltipTrigger} from '../../ui/Tooltip/TooltipTrigger' + +type Props = { + className?: string +} + +const ActivityCardFavorite = (props: Props) => { + const {className} = props + const [isSelected, setIsSelected] = useState(false) + const tooltipCopy = isSelected ? 'Remove from favorites' : 'Add to favorites' + + const handleClick = (e: React.MouseEvent) => { + e.preventDefault() + setIsSelected((prev) => !prev) + } + + return ( + +
+ + + +
+ + {tooltipCopy} + +
+ ) +} + +export default ActivityCardFavorite diff --git a/packages/client/components/ActivityLibrary/ActivityDetails/TemplateDetails.tsx b/packages/client/components/ActivityLibrary/ActivityDetails/TemplateDetails.tsx index b0ca11e0583..54ec5449623 100644 --- a/packages/client/components/ActivityLibrary/ActivityDetails/TemplateDetails.tsx +++ b/packages/client/components/ActivityLibrary/ActivityDetails/TemplateDetails.tsx @@ -23,6 +23,7 @@ import {setActiveTemplate} from '../../../utils/relay/setActiveTemplate' import useTemplateDescription from '../../../utils/useTemplateDescription' import DetailAction from '../../DetailAction' import FlatButton from '../../FlatButton' +import ActivityCardFavorite from '../ActivityCardFavorite' import {QUICK_START_CATEGORY_ID} from '../Categories' import TeamPickerModal from '../TeamPickerModal' import ActivityDetailsBadges from './ActivityDetailsBadges' @@ -258,15 +259,18 @@ export const TemplateDetails = (props: Props) => { {!isOwner && __typename !== 'FixedActivity' && (
{description}
-
- - -
Clone & Edit
-
+
+ +
+ + +
Clone & Edit
+
+
)} diff --git a/packages/client/components/ActivityLibrary/ActivityGrid.tsx b/packages/client/components/ActivityLibrary/ActivityGrid.tsx index dbfbbbe9f66..e53b251cff8 100644 --- a/packages/client/components/ActivityLibrary/ActivityGrid.tsx +++ b/packages/client/components/ActivityLibrary/ActivityGrid.tsx @@ -2,6 +2,7 @@ import React from 'react' import {Link} from 'react-router-dom' import {ActivityBadge} from './ActivityBadge' import {ActivityCard, ActivityCardImage} from './ActivityCard' +import ActivityCardFavorite from './ActivityCardFavorite' import {Template} from './ActivityLibrary' import {ActivityLibraryCardDescription} from './ActivityLibraryCardDescription' import {CATEGORY_THEMES, CategoryID} from './Categories' @@ -42,6 +43,7 @@ const ActivityGrid = ({templates, selectedCategory}: ActivityGridProps) => { src={template.illustrationUrl} category={template.category as CategoryID} /> + {
- {(availableCategoryIds as Array).map( + {(availableCategoryIds as Array).map( (category) => ( { to={`/activity-library/category/${category}`} onClick={() => resetQuery()} key={category} + style={{ + color: + category === 'favorite' + ? category === categoryId + ? 'white' + : 'red' + : undefined + }} > {CATEGORY_ID_TO_NAME[category]} diff --git a/packages/client/components/ActivityLibrary/ActivityLibraryEmptyState.tsx b/packages/client/components/ActivityLibrary/ActivityLibraryEmptyState.tsx index 8b112783c50..f68ac23d1fe 100644 --- a/packages/client/components/ActivityLibrary/ActivityLibraryEmptyState.tsx +++ b/packages/client/components/ActivityLibrary/ActivityLibraryEmptyState.tsx @@ -1,4 +1,6 @@ +import FavoriteIcon from '@mui/icons-material/Favorite' import React from 'react' +import favoriteImg from '../../../../static/images/illustrations/favorite-empty-state.png' import halloweenRetrospectiveTemplate from '../../../../static/images/illustrations/halloweenRetrospectiveTemplate.png' import {AllCategoryID, QUICK_START_CATEGORY_ID} from './Categories' import CreateActivityCard from './CreateActivityCard' @@ -12,6 +14,32 @@ const ActivityLibraryEmptyState = (props: Props) => { const {categoryId, searchQuery} = props const showResultsNotFound = categoryId !== 'custom' || searchQuery !== '' + if (categoryId === 'favorite') { + return ( +
+
+ Favorite placeholder +
+
+ + + + Activities you mark as favorite will show up here + +
+
+
+
+ ) + } + return (
diff --git a/packages/client/components/ActivityLibrary/Categories.ts b/packages/client/components/ActivityLibrary/Categories.tsx similarity index 79% rename from packages/client/components/ActivityLibrary/Categories.ts rename to packages/client/components/ActivityLibrary/Categories.tsx index 57b66dbd474..099910ec28b 100644 --- a/packages/client/components/ActivityLibrary/Categories.ts +++ b/packages/client/components/ActivityLibrary/Categories.tsx @@ -1,3 +1,5 @@ +import FavoriteIcon from '@mui/icons-material/Favorite' +import React from 'react' import {MeetingTypeEnum} from '../../__generated__/MeetingSelectorQuery.graphql' import {CardTheme} from './ActivityCard' @@ -13,10 +15,12 @@ export const MAIN_CATEGORIES = [ export const QUICK_START_CATEGORY_ID = 'recommended' export const CUSTOM_CATEGORY_ID = 'custom' +export const FAVORITE_CATEGORY_ID = 'favorite' export const ALL_CATEGORIES = [ QUICK_START_CATEGORY_ID, ...MAIN_CATEGORIES, + FAVORITE_CATEGORY_ID, CUSTOM_CATEGORY_ID ] as const @@ -46,11 +50,26 @@ export const CATEGORY_THEMES: Record = { primary: 'bg-fuscia-400', secondary: 'bg-slate-200', text: 'text-slate-500' + }, + [FAVORITE_CATEGORY_ID]: { + primary: 'bg-grape-700', + secondary: 'bg-slate-200', + text: 'text-slate-500' } } -export const CATEGORY_ID_TO_NAME: Record = { +export const CATEGORY_ID_TO_NAME: Record = { [QUICK_START_CATEGORY_ID]: 'Quick Start', + [FAVORITE_CATEGORY_ID]: ( + + ), [CUSTOM_CATEGORY_ID]: 'Custom', retrospective: 'Retrospective', estimation: 'Estimation', diff --git a/static/images/illustrations/favorite-empty-state.png b/static/images/illustrations/favorite-empty-state.png new file mode 100644 index 00000000000..53067b97d41 Binary files /dev/null and b/static/images/illustrations/favorite-empty-state.png differ