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

[3주차-ts] 이상형월드컵 자스👉타스 #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions dist/App.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/App.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions dist/components/GameImg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/components/GameImg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions dist/pages/Game.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/pages/Game.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions dist/pages/Result.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/pages/Result.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions dist/style/GlobalStyle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/style/GlobalStyle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/types/type.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/types/type.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/styled-components": "^5.1.25",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"styled-components": "^5.3.5",
"styled-reset": "^4.3.4",
Expand Down Expand Up @@ -36,5 +38,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"typescript": "^4.7.4"
}
}
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

7 changes: 4 additions & 3 deletions src/App.js → src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import "./App.css";
import Game from './pages/Game';
import Result from './pages/Result';
import GlobalStyle from './components/GlobalStyle';
import GlobalStyle from './style/GlobalStyle';
import React from 'react';
function App() {

return (<>
return (
<>
<GlobalStyle/>
<Game/>
Comment on lines +7 to 10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

      <ThemeProvider theme={theme}>

theme도 적용해봤으면 좋겠구! GlobalStyle은 components폴더가 아니라 styles 폴더가 따로 있어야 할것같아!

{/* <Result/> */}
Expand Down
10 changes: 6 additions & 4 deletions src/components/GameImg.jsx → src/components/GameImg.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { React, useState, useEffect, useRef } from "react";
import React from "react";
import { ImgProperty } from '../types/type';
import styled from "styled-components";

const ImgContainer = styled.div`
Expand All @@ -25,14 +26,15 @@ const Desc = styled.h1`
color: white;
text-shadow: 3px 3px 3px black; //글자 잘 안 보여서 shadow 설정
`;

//게임에 사용되는 이미지 컴포넌트
function GameImg({ src, name, onClick }) {
function GameImg({ src, title, onClick }:ImgProperty) {
//src: 이미지 , name: 사진에 대한 이름, onCLick: 온클릭 함수

return (
<ImgContainer onClick={onClick}>
<StyledImg src={src} name={name} />
<Desc>{name}</Desc>
<StyledImg src={src} title={title} />
<Desc>{title}</Desc>
</ImgContainer>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.jpg";
declare module "*.png";
declare module "*.jpge";
declare module "*.gif";
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom.d.ts도 네이밍이 명확하지는 않은것같아!

customImg.d.ts 도 나쁘지는 않은듯!

3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
Expand All @@ -14,4 +13,4 @@ root.render(
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

Loading