Skip to content

Commit

Permalink
add propTypes and fix styled to TaskColumnCard
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksArden committed May 8, 2023
1 parent b80db1b commit b25a61a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
35 changes: 18 additions & 17 deletions src/components/ChoosedDay/TaskColumnCard/TaskColumnCard.jsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import PropTypes from 'prop-types';
import { Avatar } from 'components/Avatar/Avatar';
import {
Container,
TaskPriority,
TaskAvatarWrapper,
TaskTitle,
Wrapper,
} from './TaskColumnCard.styled';
import { TaskToolbar } from '../TaskToolbar/TaskToolbar';
import { TASK_PRIORITY } from 'constants/taskPriority.constants';

import * as STC from './TaskColumnCard.styled';

export const TaskColumnCard = ({
title = 'Lorem ipsum dolor sit amet consectetur ',
priority = TASK_PRIORITY.low,
...other
}) => {
return (
<Container>
<TaskTitle>{title}</TaskTitle>
<Wrapper>
<Wrapper>
<TaskAvatarWrapper>
<STC.Container>
<STC.TaskTitle>{title}</STC.TaskTitle>
<STC.Wrapper>
<STC.Wrapper>
<STC.TaskAvatarWrapper>
<Avatar />
</TaskAvatarWrapper>
<TaskPriority priority={priority}>{priority}</TaskPriority>
</Wrapper>
</STC.TaskAvatarWrapper>
<STC.TaskPriority priority={priority}>{priority}</STC.TaskPriority>
</STC.Wrapper>
<TaskToolbar title={title} priority={priority} {...other} />
</Wrapper>
</Container>
</STC.Wrapper>
</STC.Container>
);
};
TaskColumnCard.propTypes = {
title: PropTypes.string.isRequired,
priority: PropTypes.object.isRequired,
other: PropTypes.node,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const Container = styled.div`
display: flex;
flex-direction: column;
gap: 28px;
padding: 14px 15px 18px 14px;
padding: 14px 15px 18px 14px;
width: 100%;
background-color: var(--secondary-background-color);
Expand Down Expand Up @@ -39,6 +39,7 @@ export const TaskAvatarWrapper = styled.div`

export const TaskPriority = styled.p`
padding: 4px 12px;
background: var(
${props => {
if (props.priority === TASK_PRIORITY.medium) {
Expand All @@ -56,7 +57,6 @@ export const TaskPriority = styled.p`
font-weight: 600;
font-size: 10px;
line-height: 1.2;
text-align: center;
color: var(--btn-text-color);
Expand Down

0 comments on commit b25a61a

Please sign in to comment.