Skip to content

Commit 975eaff

Browse files
authored
Merge pull request #27 from pythonkr/fix/sponsor-api-call
Fix: 테스트용 API 주소 제거
2 parents bcec32f + 5f421c4 commit 975eaff

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/api/sponsor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Sponsor, SponsorBenefit, SponsorLevel, SponsorLevelWithSponsor } from "
66

77
export function detailSponsor(id: string): Promise<Sponsor> {
88
return new Promise((resolve, reject) => {
9-
instance.get<APISponsor>(`http://localhost:8888/2024/sponsors/list/${id}/`).then(response => {
9+
instance.get<APISponsor>(`/2024/sponsors/list/${id}/`).then(response => {
1010
resolve(Sponsor.fromAPI(response.data));
1111
}).catch(error => {
1212
console.error(error);
@@ -18,7 +18,7 @@ export function detailSponsor(id: string): Promise<Sponsor> {
1818

1919
export function listSponsorLevels(): Promise<SponsorLevel[]> {
2020
return new Promise((resolve, reject) => {
21-
instance.get<APISponsorLevel[]>("http://localhost:8888/2024/sponsors/levels").then((response) => {
21+
instance.get<APISponsorLevel[]>("/2024/sponsors/levels").then((response) => {
2222
resolve(SponsorLevel.fromAPIs(response.data));
2323
}).catch((error) => {
2424
console.error(error);
@@ -31,7 +31,7 @@ export function listSponsorLevels(): Promise<SponsorLevel[]> {
3131
export function listSponsors(): Promise<Sponsor[]> {
3232
return new Promise((resolve, reject) => {
3333
instance
34-
.get<APISponsor[]>("http://localhost:8888/2024/sponsors/list/")
34+
.get<APISponsor[]>("/2024/sponsors/list/")
3535
.then((response) => {
3636
resolve(Sponsor.fromAPIs(response.data));
3737
})
@@ -44,7 +44,7 @@ export function listSponsors(): Promise<Sponsor[]> {
4444
export function listSponsorLevelWithSponsor(): Promise<SponsorLevelWithSponsor[]> {
4545
return new Promise((resolve, reject) => {
4646
instance
47-
.get<APISponsorLevelWithSponsor[]>("http://localhost:8888/2024/sponsors/levels/with-sponsor/")
47+
.get<APISponsorLevelWithSponsor[]>("/2024/sponsors/levels/with-sponsor/")
4848
.then((response) => {
4949
console.log("debug", response);
5050
resolve(SponsorLevelWithSponsor.fromAPIs(response.data));
@@ -58,7 +58,7 @@ export function listSponsorLevelWithSponsor(): Promise<SponsorLevelWithSponsor[]
5858

5959
export function listSponsorBenefits(): Promise<SponsorBenefit[]> {
6060
return new Promise((resolve, reject) => {
61-
instance.get<APISponsorBenefit[]>("http://localhost:8888/2024/sponsors/benefits/").then(response => {
61+
instance.get<APISponsorBenefit[]>("/2024/sponsors/benefits/").then(response => {
6262
resolve(SponsorBenefit.fromAPIs(response.data));
6363
}).catch(error => {
6464
console.error(error);

src/components/Footer/SponsorTable.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ function SponsorTable({ max, levelName, sponsors, ...rest }: Props) {
1616
<div style={{ gridTemplateColumns: `repeat(${max}, 1fr)` }}>
1717
{sponsors.map((sponsor) => (
1818
<Link to={`/sponsoring/sponsor/${sponsor.id}`} relative="path">
19-
<img src={sponsor.logo_image} alt={sponsor.name} />
19+
<LogoImage src={sponsor.logo_image} alt={sponsor.name} />
2020
</Link>
2121
))}
2222
</div>
2323
</SponsorCard>
2424
);
2525
}
2626

27+
const LogoImage = styled.img`
28+
background: white;
29+
color: black;
30+
`;
31+
2732
const SponsorCard = styled.div`
2833
border: 1px solid #b0a8fe;
2934
border-radius: 16px;

src/pages/Sponsor/SponsorDetail.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SponsorDetail: React.FC<{ sponsor: APISponsor }> = ({ sponsor }) => {
1313
<Vertical>
1414
<H1>{sponsor.name}</H1>
1515
<a href={sponsor.url}>
16-
<img src={sponsor.logo_image} alt={sponsor.name} />
16+
<LogoImage src={sponsor.logo_image} alt={sponsor.name} />
1717
</a>
1818
<H3 dangerouslySetInnerHTML={{ __html: sponsor.desc }}></H3>
1919
</Vertical>
@@ -48,6 +48,12 @@ const SponsorDetailPage = () => {
4848

4949
export default SponsorDetailPage;
5050

51+
const LogoImage = styled.img`
52+
background: white;
53+
color: black;
54+
max-width: 50%;
55+
`;
56+
5157
const Container = styled.div`
5258
display: flex;
5359
justify-content: center;

0 commit comments

Comments
 (0)