Skip to content

Commit

Permalink
Fix NewsList with scroll & MainPage GotoStockPage at time & Header op…
Browse files Browse the repository at this point in the history
…acity
  • Loading branch information
Climier-code committed Jun 16, 2021
1 parent 487ef64 commit a0dce0d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {NewsAPIKEY} from '../key/apikey';

export async function getNews(national:string) {
const response = await axios.get<News>(
`https://newsapi.org/v2/top-headlines?country=${national}&category=business&pageSize=6&apiKey=${NewsAPIKEY}`
`https://newsapi.org/v2/top-headlines?country=${national}&category=business&apiKey=${NewsAPIKEY}`
);

return response.data;
Expand Down
7 changes: 7 additions & 0 deletions src/components/News/NewsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ const NewsListBlock = styled.div`
box-shadow: 0.5rem 0.5rem;
padding: 1rem;
margin-right: 0.5rem;
@media (min-width: 768px) {
height: 50rem;
overflow-y: auto;
}
`;

type NewsListProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const CategoriesBeforeBlock = styled.div`
align-items: center;
justify-content: center;
flex-direction: column;
opacity:0.3;
opacity:0.6;
@media screen and (max-width: 768px) {
top: 0;
Expand Down
4 changes: 3 additions & 1 deletion src/containers/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ function Main () {
if (nowHour === 23 && 30 <= moment().minute()){
setTimecase(4)
}
setTimecase(3)
else {
setTimecase(3)
}
}
else {
setTimecase(4)
Expand Down

0 comments on commit a0dce0d

Please sign in to comment.