Skip to content

Commit 7b2d9bc

Browse files
committed
[refactor] 알콜도수 도수 색 변화
1 parent 26344c0 commit 7b2d9bc

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

src/domains/mypage/components/pages/my-bar/MyBar.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22
import { getApi } from '@/app/api/config/appConfig';
33
import CocktailCard from '@/domains/shared/components/cocktail-card/CocktailCard';
4+
import Link from 'next/link';
45
import { useEffect, useState } from 'react';
56

67
interface MyCocktail {
@@ -37,14 +38,15 @@ function MyBar() {
3738
"
3839
>
3940
{myCocktail.map(({ cocktailId, cocktailName, imageUrl }) => (
40-
<CocktailCard
41-
key={cocktailId}
42-
src={imageUrl}
43-
textSize1="text-xl"
44-
name={cocktailName}
45-
nameKo="올드 패션드"
46-
keep={false}
47-
></CocktailCard>
41+
<Link href={`/recipe/${cocktailId}`} key={cocktailId}>
42+
<CocktailCard
43+
src={imageUrl}
44+
textSize1="text-xl"
45+
name={cocktailName}
46+
nameKo="올드 패션드"
47+
keep={false}
48+
></CocktailCard>
49+
</Link>
4850
))}
4951
</div>
5052
) : (

src/domains/mypage/main/MyAbv.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ function MyAbv({ abv }: { abv: number }) {
99
const viewPoint = isMd ? 'web' : 'mobileLongText';
1010
const fixedAbv = abv.toFixed(1);
1111

12+
const t = Math.min(1, Math.max(0, abv / 100));
13+
14+
// HEX → RGB
15+
const from = [255, 202, 141]; // FFCA8D
16+
const to = [250, 36, 36]; // FA2424
17+
18+
// RGB
19+
const r = Math.round(from[0] + (to[0] - from[0]) * t);
20+
const g = Math.round(from[1] + (to[1] - from[1]) * t);
21+
const b = Math.round(from[2] + (to[2] - from[2]) * t);
22+
const color = `rgb(${r}, ${g}, ${b})`;
23+
1224
return (
1325
<dl className="flex justify-between items-center text-gray-dark gap-2">
1426
<dt className="flex gap-1 items-center">
@@ -23,7 +35,10 @@ function MyAbv({ abv }: { abv: number }) {
2335
</ToolTip>
2436
</dt>
2537
<dd className="text-base">
26-
<span className="text-2xl md:text-4xl font-bold">{fixedAbv}</span>%
38+
<span className="text-2xl md:text-4xl font-bold" style={{ color }}>
39+
{fixedAbv}
40+
</span>
41+
%
2742
</dd>
2843
</dl>
2944
);

src/domains/mypage/main/MySetting.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import WithdrawModal from '@/domains/mypage/components/WithdrawModal';
55
import TextButton from '@/shared/components/button/TextButton';
66
import { useEffect, useState } from 'react';
77
import useFetchProfile from '../api/fetchProfile';
8-
import AlarmConfirm from '../components/pages/my-alarm/AlarmConfirm';
98

109
function MySetting() {
1110
const { profile } = useFetchProfile();

src/domains/shared/components/abv-graph/AbvGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function AbvGraph({ max, abv, type = 'cocktail' }: Props) {
2828

2929
const bandClass = clsx(
3030
'h-full rounded-full transition-[width] duration-500',
31-
'bg-gradient-to-r from-amber-300 to-red-500', // 기본 그라데이션
31+
'bg-gradient-to-r from-[#FFCA8D] to-[#FA2424]', // 기본 그라데이션
3232
pct >= 80 && 'shadow-[0_0_12px_rgba(250,36,36,0.45)]'
3333
);
3434

0 commit comments

Comments
 (0)