Skip to content

Commit

Permalink
yapp-project#26 파일(이미지) 업로드 및 데이터베이스 업로드
Browse files Browse the repository at this point in the history
See: Github issue yapp-project#26
Merge 및 conflict 해결

Merge commit 'af1859233a23e62557e7951c85cfda80f92c97ad' into drinkme#26

# Conflicts:
#	src/containers/ViewRecipe/ViewRecipe.jsx
  • Loading branch information
Sung-jin committed May 25, 2019
2 parents 513776c + af18592 commit 3693dcd
Show file tree
Hide file tree
Showing 20 changed files with 585 additions and 157 deletions.
30 changes: 14 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import React, { Component } from "react";
import { Route, Switch, withRouter } from "react-router-dom";
import { connect } from "react-redux";
import {
MainView,
Header,
LoginPopup,
Enrolment,
ViewRecipe,
MyMenu
} from "./containers";
import { MainView, Header, Enrolment, ViewRecipe, MyMenu } from "./containers";
import classNames from "classnames/bind";
import styles from "./App.scss";
const cx = classNames.bind(styles);
Expand All @@ -20,22 +13,27 @@ const mapDispatchToProps = dispatch => ({});

class App extends Component {
render() {
const bEnrolment =
this.props.location.pathname.indexOf("enrolment") > 0 ? true : false;
return (
<div className={cx("App")}>
<div className={cx("App", bEnrolment ? "one" : "")}>
<div className={cx("top")}>
<Switch>
<Route exact path="/enrolment/:id" component={Enrolment} />
<Route exact path="/enrolment" component={Enrolment} />
<Route path="/" component={Header} />
</Switch>
</div>
<div className={cx("body")}>
<Switch>
<Route exact path="/" component={MainView} />
<Route exact path="/viewRecipe" component={ViewRecipe} />
<Route exact path="/mymenu" component={MyMenu} />
</Switch>
</div>
{!bEnrolment && (
<div className={cx("body")}>
<Switch>
<Route exact path="/" component={MainView} />
<Route exact path="/viewRecipe/:id" component={ViewRecipe} />
<Route exact path="/viewRecipe" component={ViewRecipe} />
<Route exact path="/mymenu" component={MyMenu} />
</Switch>
</div>
)}
</div>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
position: absolute;
display: grid;
grid-template-rows: 80px auto;
&.one {
grid-template-rows: auto;
}
height: 100%;
width: 100%;
.top {
position: absolute;
grid-row: 1 / span 1;
height: 100%;
width: 100%;
Expand Down
9 changes: 9 additions & 0 deletions src/api/userAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,12 @@ export async function setUserDelete(userid, password) {
const res = await webRequestUtil.post({ url, body });
return res.data;
}

export async function deleteCocktail(id) {
const url = "del/";
const body = {
id
};
const res = await webRequestUtil.get({ url, body });
return res.data;
}
7 changes: 4 additions & 3 deletions src/components/SearchResultItem/SearchResultItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import classNames from "classnames/bind";
import styles from "./SearchResultItem.scss";
import xbox from "../../static/images/a1.jpeg";
import xbox from "../../static/images/ErrorImage.svg";

const cx = classNames.bind(styles);

Expand All @@ -26,6 +26,7 @@ const SearchResultItem = ({
onError={e => {
e.target.onerror = null;
e.target.src = xbox;
e.target.className = cx("item_img", "_xbox");
}}
src={image}
alt="사진"
Expand All @@ -41,13 +42,13 @@ const SearchResultItem = ({
</div>
</div>
)}
<div className={cx("information_rect")} onClick={informationClick}>
<div id={_id} className={cx("information_rect")} onClick={informationClick}>
<div className={cx("inner")}>
<div className={cx("cocktailName")}>{name}</div>
<div className={cx("bottom")}>
<div className={cx("userName")}>{owner}</div>
<div className={cx("right")}>
<div className={cx("like")} onClick={likeClick} />
<div id={_id} className={cx("like")} onClick={likeClick} />
<div className={cx("number")}>{scrap}</div>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion src/components/SearchResultItem/SearchResultItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
.item_img {
width: inherit;
height: inherit;

&._xbox {
min-width: 360px;
background-color: gray;
opacity: 0.5;
}
}

.modify_rect {
Expand Down Expand Up @@ -60,7 +66,6 @@
letter-spacing: normal;
text-align: left;
color: #ffffff;
cursor: pointer;
}

.bottom {
Expand Down Expand Up @@ -100,6 +105,7 @@
background-position: center;
background-size: inherit;
margin-right: 10.2px;
cursor: pointer;
}
.number {
height: 100%;
Expand Down
Loading

0 comments on commit 3693dcd

Please sign in to comment.