Skip to content

Commit 7b43e62

Browse files
authored
fix: 템플릿 배경 색상 적용 안되는 문제 수정 (#70)
* fix: background-color가 아닌 background 속성으로 배경 색상을 지정하도록 수정 * fix: 시간표 템플릿의 학생 정보 텍스트 색상 수정
1 parent e4d0ef3 commit 7b43e62

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/Timetable.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const SharingHeader = ({ bgColor, textColor }: TimetableHeaderProps) => {
152152
<div
153153
className={`absolute top-0 left-1/2 flex -translate-x-1/2 items-center rounded-b-xl px-4 py-1 whitespace-nowrap`}
154154
style={{
155-
backgroundColor: bgColor,
155+
background: bgColor,
156156
}}
157157
>
158158
<h3 className="text-xs font-semibold">{TIME_TABLE_TAG[tag]}</h3>
@@ -175,7 +175,7 @@ const Timetable = ({ children, timetable, className, ...props }: TimetableProps)
175175
return (
176176
<TimetableContext.Provider value={{ totalCredit, tag: timetable.tag }}>
177177
<div
178-
className={`w-full overflow-hidden rounded-xl border-2 ${twMerge(className)}`}
178+
className={`${twMerge('w-full overflow-hidden rounded-xl border-2', className)}`}
179179
{...props}
180180
>
181181
{/* Timetable Header */}

src/components/TimetableSharingTemplate.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface Color {
1616
templateContentBg: string;
1717
tableHeaderBg: string;
1818
headerText: string;
19+
studentText: string;
1920
chipBg: string;
2021
chipText: string;
2122
}
@@ -26,6 +27,7 @@ export const TEMPLATE_COLORS: Color[] = [
2627
templateContentBg: 'linear-gradient(161deg, #3D3D3D 5.9%, #181818 96.88%)',
2728
tableHeaderBg: '#3D3D3D',
2829
headerText: '#FFFFFF',
30+
studentText: '#FFFFFF',
2931
chipBg: 'rgba(42, 42, 42, 0.36)',
3032
chipText: '#FFFFFF',
3133
},
@@ -34,6 +36,7 @@ export const TEMPLATE_COLORS: Color[] = [
3436
templateContentBg: '#1554DB',
3537
tableHeaderBg: '#1554DB',
3638
headerText: '#FFFFFF',
39+
studentText: '#FFFFFF',
3740
chipBg: 'rgba(42, 42, 42, 0.36)',
3841
chipText: '#FFFFFF',
3942
},
@@ -43,6 +46,7 @@ export const TEMPLATE_COLORS: Color[] = [
4346
templateContentBg: '#F9F9F9',
4447
tableHeaderBg: '#F9F9F9',
4548
headerText: '#292929',
49+
studentText: '#292929',
4650
chipBg: 'rgba(42, 42, 42, 0.36)',
4751
chipText: '#FFFFFF',
4852
},
@@ -51,6 +55,7 @@ export const TEMPLATE_COLORS: Color[] = [
5155
templateContentBg: 'linear-gradient(180deg, #A4B9FF 0%, #E2A9D0 100%)',
5256
tableHeaderBg: '#A4B9FF',
5357
headerText: '#FFFFFF',
58+
studentText: '#FFFFFF',
5459
chipBg: 'rgba(255, 255, 255, 0.25)',
5560
chipText: '#FFFFFF',
5661
},
@@ -61,6 +66,7 @@ export const TEMPLATE_COLORS: Color[] = [
6166
tableHeaderBg:
6267
'linear-gradient(90deg, #C5E7FF 0%, #FDE8FF 31.21%, #DDE7FF 69.21%, #ECE8FF 91.71%)',
6368
headerText: '#FFFFFF',
69+
studentText: '#292929',
6470
chipBg: 'rgba(255, 255, 255, 0.25)',
6571
chipText: '#292929',
6672
},
@@ -127,7 +133,7 @@ const TemplateCreditChip = ({
127133
<div
128134
className={`flex items-center gap-2 rounded-xl px-2 py-1`}
129135
style={{
130-
backgroundColor: bgColor,
136+
background: bgColor,
131137
color: textColor,
132138
}}
133139
>
@@ -190,7 +196,7 @@ const TimetableSharingTemplate = forwardRef<HTMLDivElement, TimetableSharingTemp
190196
textColor={color.headerText}
191197
/>
192198
</Timetable>
193-
<TemplateStudent textColor={color.headerText} />
199+
<TemplateStudent textColor={color.studentText} />
194200
<TemplateCredit>
195201
<TemplateCreditChip bgColor={color.chipBg} textColor={color.chipText}>
196202
<div className="text-[10px]">이수학점</div>

0 commit comments

Comments
 (0)