File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
app/login/_components/do-you-know Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ import { connection } from "next/server";
55export default async function DoYouKnow ( ) {
66 await connection ( ) ;
77
8+ const randomKnow = await getDoYouKnow ( ) ;
9+
10+ return (
11+ < div className = "flex flex-col justify-center gap-2 text-center" >
12+ < div className = "text-sm text-gray-500" > 你知道嗎?</ div >
13+ < div className = "font-normal" > { randomKnow } </ div >
14+ </ div >
15+ ) ;
16+ }
17+
18+ export async function getDoYouKnow ( ) {
819 const knowsList = [
920 < p key = "do-you-knows-daily-login" >
1021 每天登入可以獲得 20 點點數,< br /> 連續 7 天登入可以獲得 50 點加成!
@@ -21,10 +32,6 @@ export default async function DoYouKnow() {
2132 ] ;
2233
2334 const randomKnow = knowsList [ Math . floor ( Math . random ( ) * knowsList . length ) ] ;
24- return (
25- < div className = "flex flex-col justify-center gap-2 text-center" >
26- < div className = "text-sm text-gray-500" > 你知道嗎?</ div >
27- < div className = "font-normal" > { randomKnow } </ div >
28- </ div >
29- ) ;
35+
36+ return randomKnow ;
3037}
You can’t perform that action at this time.
0 commit comments