-
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.
Merge pull request #20 from pythonkr/feature/sponsor
Feat: 후원사 페이지 API 연동
- Loading branch information
Showing
16 changed files
with
859 additions
and
522 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 +1 @@ | ||
REACT_APP_PYCONKR_API=https://payment-dev.pycon.kr | ||
REACT_APP_PYCONKR_API=https://api-dev.pycon.kr |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { SponsorAPI } from "api"; | ||
import React, { useEffect, useState } from "react"; | ||
import useTranslation from "utils/hooks/useTranslation"; | ||
import { SponsorLevelWithSponsor } from "models/sponsor"; | ||
import styled from "styled-components"; | ||
import SponsorTable from "./SponsorTable"; | ||
|
||
const SponsorList = () => { | ||
const t = useTranslation(); | ||
const [listOfSponsorLevel, setListOfSponsorLevel] = useState<SponsorLevelWithSponsor[]>([]); | ||
|
||
useEffect(() => { | ||
SponsorAPI.listSponsorLevelWithSponsor().then((levels) => { | ||
setListOfSponsorLevel(levels); | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<Container> | ||
<Vertical> | ||
<H1>{t("후원사 목록")}</H1> | ||
<SponsorTableList> | ||
{listOfSponsorLevel.map((level) => ( | ||
<SponsorTable | ||
max={level.name.toLowerCase() === "keystone" ? 1 : 4} | ||
levelName={t(level.name)} | ||
sponsors={level.sponsor} | ||
/> | ||
))} | ||
</SponsorTableList> | ||
</Vertical> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default SponsorList; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 2rem 0; | ||
width: 100%; | ||
&:nth-child(even) { | ||
background-color: #141414; | ||
} | ||
`; | ||
|
||
const Vertical = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
margin-bottom: 2rem; | ||
width: 100%; | ||
`; | ||
|
||
const SponsorTableList = styled.div` | ||
& > div + div { | ||
margin-top: 2rem; | ||
} | ||
`; | ||
|
||
const H1 = styled.h1` | ||
margin-top: 3rem; | ||
font-size: 40px; | ||
color: #b0a8fe; | ||
@media only screen and (max-width: 810px) { | ||
padding: 0 1rem; | ||
font-size: 24px; | ||
} | ||
`; |
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
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
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
Oops, something went wrong.