File tree 8 files changed +79
-70
lines changed 8 files changed +79
-70
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const TwentyFourHoursRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '24시간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '24시간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const TwentyFourHoursRank = () => {
80
82
< RankHeader title = '24시간 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< ul className = 'mt-5 space-y-3' >
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const AllTimeRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '누적 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '누적 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const AllTimeRank = () => {
80
82
< RankHeader title = '누적 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< ul className = 'mt-5 space-y-3' >
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const DailyRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '일간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '일간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const DailyRank = () => {
80
82
< RankHeader title = '일간 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< ul className = 'mt-5 space-y-3' >
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const HourlyRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '매시간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '매시간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const MonthlyRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '월간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '월간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const MonthlyRank = () => {
80
82
< RankHeader title = '월간 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< ul className = 'mt-5 space-y-3' >
Original file line number Diff line number Diff line change @@ -56,15 +56,17 @@ const NewestRank = () => {
56
56
/>
57
57
) ;
58
58
59
+ const getButtons = ( ) => {
60
+ if ( ranks . ranking . length <= 50 ) {
61
+ return [ button1to50 ] ;
62
+ } else {
63
+ return [ button1to50 , button51to100 ] ;
64
+ }
65
+ } ;
66
+
59
67
return (
60
68
< >
61
- < SmallHeader ref = { headerRef } title = '신곡 차트' buttons = { ( ( ) => {
62
- if ( ranks . ranking . length <= 50 ) {
63
- return [ button1to50 ] ;
64
- } else {
65
- return [ button1to50 , button51to100 ] ;
66
- }
67
- } ) ( ) } />
69
+ < SmallHeader ref = { headerRef } title = '신곡 차트' buttons = { getButtons ( ) } />
68
70
< motion . div
69
71
initial = { { opacity : 0 , y : 10 } }
70
72
animate = { { opacity : 1 , y : 0 } }
@@ -74,8 +76,7 @@ const NewestRank = () => {
74
76
< RankHeader title = '신곡 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
75
77
76
78
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
77
- { button1to50 }
78
- { button51to100 }
79
+ { getButtons ( ) }
79
80
</ div >
80
81
81
82
< ul className = 'mt-5 space-y-3' >
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const WeeklyRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '주간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '주간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const WeeklyRank = () => {
80
82
< RankHeader title = '주간 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< span className = 'h-px w-full bg-neutral-600' aria-hidden = 'true' />
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ const YearlyRank = () => {
62
62
/>
63
63
) ;
64
64
65
+ const getButtons = ( ) => {
66
+ if ( ranks . ranking . length <= 50 ) {
67
+ return [ button1to50 ] ;
68
+ } else {
69
+ return [ button1to50 , button51to100 ] ;
70
+ }
71
+ } ;
72
+
65
73
return (
66
74
< >
67
- < SmallHeader ref = { headerRef } title = '연간 차트' buttons = { ( ( ) => {
68
- if ( ranks . ranking . length <= 50 ) {
69
- return [ button1to50 ] ;
70
- } else {
71
- return [ button1to50 , button51to100 ] ;
72
- }
73
- } ) ( ) } />
75
+ < SmallHeader ref = { headerRef } title = '연간 차트' buttons = { getButtons ( ) } />
74
76
< motion . div
75
77
initial = { { opacity : 0 , y : 10 } }
76
78
animate = { { opacity : 1 , y : 0 } }
@@ -80,8 +82,7 @@ const YearlyRank = () => {
80
82
< RankHeader title = '연간 차트' updateDate = { dayjs ( ranks . timestamp * 1000 ) } isYearly = { true } />
81
83
82
84
< div ref = { buttonsRef } className = 'mt-5 flex gap-3' >
83
- { button1to50 }
84
- { button51to100 }
85
+ { getButtons ( ) }
85
86
</ div >
86
87
87
88
< span className = 'h-px w-full bg-neutral-600' aria-hidden = 'true' />
You can’t perform that action at this time.
0 commit comments