Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Lakehead - CEM-2602 Profile list with counter #423

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ export default {
args: {
profileData: profiles,
alt: 'Profile Image',
counterBool: false,
},
} as Meta;

export const Demo: Story<IFeaturedProfilesCardProps> = (args) => (
<FeaturedProfilesCard {...args} />
);

//todo different use cases presets.
7 changes: 5 additions & 2 deletions src/Containers/FeaturesProfileCard/FeaturedProfilesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ export interface IProfile {

export interface IFeaturedProfilesCardProps {
profileData: IProfile[];
counterBool: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation of Props goes here not on the component. You are doucmenting the type

}

export const FeaturedProfilesCard: React.FC<IFeaturedProfilesCardProps> = ({
profileData,
profileData, //the array of profiles to be displayed
counterBool, //if true, the profile counter is displayed, and if false, the counter is not displayed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs should not be on this line, put in TypeScript

...props
}): React.ReactElement => {
const renderProfileCircles = useCallback(() => {
const determineProfilePictureLimit = () => {
Expand Down Expand Up @@ -95,7 +98,7 @@ export const FeaturedProfilesCard: React.FC<IFeaturedProfilesCardProps> = ({
{renderProfileCircles()}
<FeaturedProfile icon key={ADD_USER_ICON_KEY} background="grey" />
</Container>
<CountContainer>{profileData.length}</CountContainer>
{counterBool && <CountContainer>{profileData.length}</CountContainer>}
</Holder>

);
Expand Down