Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] 소개페이지 상단 배너 로딩 속도 개선 #428

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: '18'

- name: Install pnpm
run: npm install -g pnpm@7.28.0
Expand Down
1 change: 1 addition & 0 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const getStaticProps = async () => {
aboutInfo,
memberInfo,
},
revalidate: 120,
};
};

Expand Down
15 changes: 14 additions & 1 deletion src/views/AboutPage/components/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Image from 'next/image';
import * as S from './style';

interface BannerProps {
Expand All @@ -8,7 +9,19 @@ interface BannerProps {
const Banner = (props: BannerProps) => {
const { imageSrc } = props;

return <S.Banner src={imageSrc}></S.Banner>;
return (
<S.Banner>
<Image
src={imageSrc}
alt="SOPT banner"
fill
style={{
objectFit: 'cover',
objectPosition: 'center',
}}
/>
</S.Banner>
);
};

export default Banner;
5 changes: 3 additions & 2 deletions src/views/AboutPage/components/Banner/style.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import styled from '@emotion/styled';

export const Banner = styled.div<{ src: string }>`
export const Banner = styled.div`
width: 100vw;
max-height: 630px;
height: calc(376px + 13vw);
background: center / cover no-repeat url(${({ src }) => src});
position: relative;
overflow: hidden;

/* 태블릿 뷰 */
@media (max-width: 48rem) {
Expand Down
Loading