-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate backend to yearly dividend ranking page
- Loading branch information
1 parent
8a89be6
commit c2d8231
Showing
6 changed files
with
51 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = { | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'api-ninjas-data.s3.us-west-2.amazonaws.com', | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
module.exports = nextConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/app/(main)/report/dividend/_components/dividend-row.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/app/(main)/report/dividend/yearly/_components/dividend-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 17 additions & 1 deletion
18
src/app/(main)/report/dividend/yearly/_components/header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
import React from "react"; | ||
|
||
const getYearRange = (date: Date): string => { | ||
const startDate = new Date(date); | ||
const endDate = new Date(startDate.getFullYear() + 1, startDate.getMonth(), startDate.getDate()); | ||
|
||
const startYear = startDate.getFullYear(); | ||
const startMonth = startDate.getMonth() + 1; | ||
const endYear = endDate.getFullYear(); | ||
const endMonth = endDate.getMonth() + 1; | ||
|
||
const formattedStartMonth = startMonth < 10 ? `0${startMonth}` : startMonth.toString(); | ||
const formattedEndMonth = endMonth < 10 ? `0${endMonth}` : endMonth.toString(); | ||
|
||
const dateRange = `${startYear}.${formattedStartMonth} ~ ${endYear}.${formattedEndMonth}`; | ||
return dateRange; | ||
}; | ||
|
||
export const Header = React.memo(() => { | ||
return ( | ||
<div className="flex w-full flex-col items-start justify-center gap-2 p-5"> | ||
<h2 className="text-h2 text-grey-900">Overall Dividend Rankings</h2> | ||
<p className=" text-body3 text-grey-600">YYYY.MM ~ YYYY.MM</p> | ||
<p className=" text-body3 text-grey-600">{getYearRange(new Date())}</p> | ||
</div> | ||
); | ||
}); |
Oops, something went wrong.