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

[김병화] Week6 #261

Open
wants to merge 29 commits into
base: part2-김병화
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f6ae562
Initialize project using Create React App
KimByeongHwa Nov 25, 2023
785318b
init: 프로젝트 생성
KimByeongHwa Nov 25, 2023
4e20408
feat: ThemeProvider 적용
KimByeongHwa Nov 25, 2023
d3d867e
feat: 헤더 기본 UI 완성
KimByeongHwa Nov 25, 2023
cbf1d63
feat: Footer UI 완성
KimByeongHwa Nov 25, 2023
e9b8959
style: Footer 좌우 여백 수정
KimByeongHwa Nov 25, 2023
ca1ae94
feat: Footer SNS 로고 클릭 시 이동 기능 추가
KimByeongHwa Nov 25, 2023
060324d
feat: 상단 프로필 영역 구현
KimByeongHwa Nov 25, 2023
9bd974e
refactor: 컴포넌트 폴더 구조 수정
KimByeongHwa Nov 26, 2023
62fdab9
refactor: interface 모듈화
KimByeongHwa Nov 26, 2023
16f3335
refactor: interface 모듈화
KimByeongHwa Nov 26, 2023
22d56f3
feat: Card 컴포넌트 완성
KimByeongHwa Nov 26, 2023
19d5708
feat: 하단 카드 영역 구현
KimByeongHwa Nov 26, 2023
f9e6b84
Initialize project using Create React App
KimByeongHwa Nov 25, 2023
6ce6aa6
init: 프로젝트 생성
KimByeongHwa Nov 25, 2023
be5e43a
feat: ThemeProvider 적용
KimByeongHwa Nov 25, 2023
95fe95e
feat: 헤더 기본 UI 완성
KimByeongHwa Nov 25, 2023
f145fb2
feat: Footer UI 완성
KimByeongHwa Nov 25, 2023
9fc1d64
style: Footer 좌우 여백 수정
KimByeongHwa Nov 25, 2023
b67e2ec
feat: Footer SNS 로고 클릭 시 이동 기능 추가
KimByeongHwa Nov 25, 2023
502f613
feat: 상단 프로필 영역 구현
KimByeongHwa Nov 25, 2023
3db1e18
refactor: 컴포넌트 폴더 구조 수정
KimByeongHwa Nov 26, 2023
b66cab3
refactor: interface 모듈화
KimByeongHwa Nov 26, 2023
b3bee1d
refactor: interface 모듈화
KimByeongHwa Nov 26, 2023
d7e139b
feat: Card 컴포넌트 완성
KimByeongHwa Nov 26, 2023
7644221
feat: 하단 카드 영역 구현
KimByeongHwa Nov 26, 2023
d9f0b84
feat: Card 컴포넌트 링크 기능 추가
KimByeongHwa Nov 26, 2023
63e60be
chore: commit history 동기화
KimByeongHwa Nov 26, 2023
1c93396
Merge branch 'codeit-bootcamp-frontend:main' into part2-김병화-week6
KimByeongHwa Nov 30, 2023
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
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "weekly-part2",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.1",
"styled-reset": "^4.5.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/styled-components": "^5.1.32",
"@typescript-eslint/parser": "^6.12.0",
"typescript": "^5.3.2"
}
}
Binary file added public/images/facebook-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/instagram-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/search-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/twitter-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/youtube-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css"
/>
<title>Linkbrary</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
41 changes: 41 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import reset from 'styled-reset';
import { createGlobalStyle, ThemeProvider } from 'styled-components';
import theme from './styles/theme';
import Footer from './components/layouts/Footer';
import Shared from './pages/Shared';

function App() {
const GlobalStyle = createGlobalStyle`
${reset}

*{
box-sizing: border-box;
font-family: 'Pretendard';
}

html{
font-size: 10px;
}

body{
font-size: 1.4rem;
font-family: 'Pretendard';
}

a {
text-decoration: none;
}
`;

return (
<>
<ThemeProvider theme={theme}>
<GlobalStyle />
<Shared />
<Footer />
</ThemeProvider>
</>
);
}

export default App;
80 changes: 80 additions & 0 deletions src/components/layouts/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import styled from 'styled-components';

const Wrapper = styled.div`
background-color: ${({ theme }) => theme.colors.black};
width: 100%;
height: 160px;
`;

const Container = styled.div`
font-family: 'Abel';
font-size: 1.6rem;
font-weight: 400;
color: ${({ theme }) => theme.colors.gray100};
padding: 3.2rem 10.4rem 0;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
`;

const CopyRight = styled.div``;

const NavLinks = styled.div``;

const NavLink = styled.a`
cursor: pointer;

& + & {
margin-left: 3rem;
}
`;

const SNS = styled.div`
display: flex;
align-items: center;
justify-content: center;
`;

const SNSLogoWrapper = styled.a`
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
cursor: pointer;

& + & {
margin-left: 1rem;
}
`;

function Footer() {
return (
<Wrapper>
<Container>
<CopyRight>©codeit - 2023</CopyRight>
<NavLinks>
<NavLink>Privacy Policy</NavLink>
<NavLink>FAQ</NavLink>
</NavLinks>
<SNS>
<SNSLogoWrapper href='https://www.facebook.com/' target='_blank'>
<img src='/images/facebook-icon.png' alt='facebook-icon' />
</SNSLogoWrapper>
<SNSLogoWrapper href='https://www.twitter.com/' target='_blank'>
<img src='/images/twitter-icon.png' alt='twitter-icon' />
</SNSLogoWrapper>
<SNSLogoWrapper href='https://www.youtube.com/' target='_blank'>
<img src='/images/youtube-icon.png' alt='youtube-icon' />
</SNSLogoWrapper>
<SNSLogoWrapper href='https://www.instagram.com/' target='_blank'>
<img src='/images/instagram-icon.png' alt='instagram-icon' />
</SNSLogoWrapper>
</SNS>
</Container>
</Wrapper>
);
}

export default Footer;
93 changes: 93 additions & 0 deletions src/components/layouts/ListSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { useState, useEffect } from 'react';
import styled from 'styled-components';
import Card from '../molecules/Card';
import { Folder } from '../../utils/interfaces';

const Container = styled.div`
width: 80%;
margin: 0 auto;
padding: 4rem 0;
`;

const SearchWrapper = styled.div`
width: 100%;
height: 5.4rem;
border-radius: 10px;
background-color: #f5f5f5;
position: relative;
display: flex;
align-items: center;
padding: 1.5rem 1.6rem;
`;

const SearchBar = styled.input`
background-color: #f5f5f5;
border: none;
outline: none;
font-size: 1.6rem;
margin-left: 2.6rem;
`;

const SearchIcon = styled.div`
width: 1.6rem;
height: 1.6rem;
position: absolute;
cursor: pointer;

img {
width: 100%;
height: 100%;
text-align: center;
}
`;

const CardContainer = styled.div`
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 2rem;
justify-items: center;
align-items: center;
padding: 4rem 0;
`;

function ListSection() {
const [folder, setFolder] = useState<Folder | null>(null);

const getFolderData = async () => {
try {
const res = await fetch('https://bootcamp-api.codeit.kr/api/sample/folder');
const data = await res.json();
return data;
} catch (error) {
console.log(error);
}
};

useEffect(() => {
getFolderData().then((data) => {
setFolder(data.folder);
});
}, []);
// console.log(folder);

const links = folder?.links;
// console.log(links);

return (
<Container>
<SearchWrapper>
<SearchBar placeholder='링크를 검색해 보세요' />
<SearchIcon>
<img src='/images/search-icon.png' alt='search-icon' />
</SearchIcon>
</SearchWrapper>
<CardContainer>
{links?.map((link) => (
<Card key={link.id} link={link} />
))}
</CardContainer>
</Container>
);
}

export default ListSection;
Loading