Skip to content

Commit

Permalink
refactor: ScheduleBar 스타일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
suyoungj committed Jul 20, 2023
1 parent a39241b commit d415025
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion frontend/src/components/ScheduleBar/ScheduleBar.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ export const Wrapper = styled.div<ScheduleBarProps>`
position: absolute;
top: ${({ level }) => level * 18 + 36}px;
width: ${({ duration }) => (duration * 100) / 7}%;
left: ${({ column }) => (column * 100) / 7}%;
width: ${({ duration }) => (duration * 100) / 7}%;
height: 16px;
padding: 0 4px;
`;

export const Inner = styled.div<Pick<ScheduleBarProps, 'color' | 'level'>>`
height: 100%;
background-color: ${({ color }) => color};
filter: brightness(${({ level }) => 1 + level * 0.5});
border-radius: 4px;
`;
6 changes: 4 additions & 2 deletions frontend/src/components/ScheduleBar/ScheduleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export interface ScheduleBarProps {
}

const ScheduleBar = (props: ScheduleBarProps) => {
const { color = 'red', title, ...rest } = props;
const { color = '#516FFF', title, ...rest } = props;

return (
<S.Wrapper
color={color}
title={title}
{...rest}
onClick={() => alert(title)}
/>
>
<S.Inner color={color} {...rest} />
</S.Wrapper>
);
};

Expand Down
1 change: 0 additions & 1 deletion frontend/src/utils/generateScheduleBars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ const generateRawScheduleBars = (
column,
duration,
level: 0,
color: '#000',
});
}
});
Expand Down

0 comments on commit d415025

Please sign in to comment.