Skip to content

Commit

Permalink
roll back
Browse files Browse the repository at this point in the history
  • Loading branch information
kar7mp5 committed Nov 18, 2023
1 parent 950a4a8 commit f03f460
Show file tree
Hide file tree
Showing 10 changed files with 9,502 additions and 6,044 deletions.
13,210 changes: 7,845 additions & 5,365 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
"react-modal": "^3.16.1",
"react-router-dom": "^6.18.0",
"react-script": "^2.0.5",
"react-scripts": "5.0.1",
"react-scripts": "^5.0.1",
"sass": "^1.69.5",
"typescript": "^5.2.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down Expand Up @@ -49,8 +48,11 @@
},
"devDependencies": {
"@types/jquery": "^3.5.27",
"@types/react-modal": "^3.16.3",
"gulp": "^4.0.2",
"gulp-sass": "^5.1.0"
"gulp-sass": "^5.1.0",
"typescript": "^5.2.2",
"webpack": "^4.29.6"
},
"description": "2023 메이커톤",
"main": "index.js",
Expand Down
35 changes: 10 additions & 25 deletions src/component/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
// Button.tsx
import React, { useState } from 'react';
import '../App.scss';
// Caution_Button.tsx
import React from 'react';

interface btn_type {
is_error: boolean;
is_activated: boolean;
}

interface btn_props {
interface CautionButtonProps {
title: string;
type: btn_type;
type: { is_error: boolean; is_activated: boolean };
isButtonActivated: boolean;
onClick: () => void;
}


function Button({ title, type }: btn_props): JSX.Element {
const [isActivated, setIsActivated] = useState(type.is_activated);
const handleClick = () => {
setIsActivated(!isActivated);
};
let btn_style: object = {};

if (type.is_error == true) {
btn_style = { "backgroundColor": "#F01111", "color": "white" }
}

const Caution_Button: React.FC<CautionButtonProps> = ({ title, type, isButtonActivated, onClick }) => {
return (
<div className="comp_btn">
<button style={btn_style} className={`btn_txt ${isActivated ? 'pressed' : ''}`} onClick={handleClick}>
<button className={`btn ${isButtonActivated ? 'pressed' : ''}`} onClick={onClick}>
{title}
</button>
</div>
);
}
};

export default Button;
export default Caution_Button;
21 changes: 0 additions & 21 deletions src/component/Caution_Button.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions src/images/icon_x.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/view/Caution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from 'react';
import '../App.scss';
import Icon_X from '../images/icon_x.svg';
import Nav from '../component/Nav';
import Caution_Button from '../component/Caution_Button';
import Caution_Button from '../component/Button';
import CheckList from '../component/CheckList';
import Tag from '../component/Tag'
import CircleButton from '../component/CircleButton';
Expand Down
15 changes: 6 additions & 9 deletions src/view/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Nav from '../component/Nav';
import { useNavigate } from "react-router-dom";
import $ from "jquery";
import { useLocation } from 'react-router-dom';
import Caution_Button from "../component/Caution_Button";
import Modal from 'react-modal';
import Caution_Button from "../component/Button";
// import Modal from 'react-modal';


interface jquery_node { };
Expand Down Expand Up @@ -86,12 +86,9 @@ function Home(): JSX.Element {
}, [agree_height]);

const handleCautionButtonClick = () => {
if (buttonState === true) {
window.location.href = "/Riding";
}
else {
window.alert("주의사항을 확인해 주세요.");
}
// if (buttonState === true) {
// window.location.href = "/Riding";
// }
};


Expand Down Expand Up @@ -140,7 +137,7 @@ function Home(): JSX.Element {
</div>
</div>
</div>
</div >
</div>
);
}

Expand Down
3 changes: 1 addition & 2 deletions src/view/Riding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import '../App.scss'
import Nav from '../component/Nav';
import Body from '../component/Body';
import Button from '../component/Button';
import Caution_Button from '../component/Caution_Button';
import Caution_Button from '../component/Button';

const Riding: React.FC = () => {
// Define your timer properties
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "preserve"
},
"include": [
"src"
Expand Down
Loading

0 comments on commit f03f460

Please sign in to comment.