-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from ICT-FUNney/feat/uploadPage
Feat/upload page
- Loading branch information
Showing
11 changed files
with
213 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import * as request from "superagent"; | ||
|
||
export const getSearchResult = (docName) => { | ||
return request.get(`https://private-anon-14c3863ce4-finds1.apiary-mock.com/search/${docName}`) | ||
return request.get(`https://private-anon-09b303e34c-finds1.apiary-mock.com/search/${docName}`) | ||
.then(res => { | ||
return {res:res.body}; | ||
return { res: res.body }; | ||
}).catch(err => { | ||
console.log(err); | ||
return {err}; | ||
return { err }; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import * as request from "superagent"; | ||
|
||
export const getUserDocument = (id) => { | ||
return request.get(`https://private-anon-14c3863ce4-finds1.apiary-mock.com/documents/${id}`) | ||
return request.get(`https://private-anon-09b303e34c-finds1.apiary-mock.com/search/${id}`) | ||
.then(res => { | ||
return {res:res.body}; | ||
return { res: res.body }; | ||
}).catch(err => { | ||
console.log(err); | ||
return {err}; | ||
return { err }; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import * as request from "superagent"; | ||
|
||
export const getUserInfo = (userId) => { | ||
return request.get(`http://private-anon-14c3863ce4-finds1.apiary-mock.com/userinfo/${userId}`) | ||
return request.get(`https://private-anon-09b303e34c-finds1.apiary-mock.com/search/${userId}`) | ||
.then(res => { | ||
console.log(res) | ||
return { res: res.body }; | ||
}).catch(err => { | ||
console.log(err); | ||
return {err}; | ||
return { err }; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import React, { useState } from 'react'; | ||
import { withRouter } from 'react-router'; | ||
import Box from '@material-ui/core/Box'; | ||
import { | ||
makeStyles, | ||
withStyles | ||
} from '@material-ui/core/styles'; | ||
import { push } from "connected-react-router"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import Button from '@material-ui/core/Button'; | ||
import { IconButton } from '@material-ui/core'; | ||
import Publish from '@material-ui/icons/Publish'; | ||
import Input from '@material-ui/core/Input'; | ||
import TextField from '@material-ui/core/TextField'; | ||
import InputAdornment from '@material-ui/core/InputAdornment'; | ||
import { deepPurple } from '@material-ui/core/colors'; | ||
import '../styles/uploadPage.css'; | ||
const darkViolet = deepPurple['A700']; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
upload_icon_margin: { | ||
display: "block", | ||
margin: "0 auto" | ||
}, | ||
upload_icon: { | ||
color: "black", | ||
fontSize: "35px", | ||
}, | ||
upload_input: { | ||
marginTop: "5px" | ||
}, | ||
upload_button_bottom: { | ||
marginTop: "5%" | ||
} | ||
})); | ||
|
||
const ColorButton = withStyles(theme => ({ | ||
root: { | ||
color: theme.palette.getContrastText(darkViolet), | ||
backgroundColor: darkViolet, | ||
'&:hover': { | ||
backgroundColor: darkViolet, | ||
}, | ||
}, | ||
}))(Button); | ||
|
||
const UploadPage = props => { | ||
const classes = useStyles(); | ||
const dispatch = useDispatch(); | ||
const moveToHome = () => { | ||
return (dispatch(push("/home"))); | ||
} | ||
return ( | ||
<div className="upload_reset"> | ||
<div className="upload_margin"></div> | ||
<Box borderRadius="10%" className="upload_box"> | ||
<div className="upload_inner"> | ||
<IconButton className={classes.upload_icon_margin}> | ||
<Publish className={classes.upload_icon} /> | ||
</IconButton> | ||
<p className="upload_icon_bottom">ノートをアップロードする</p> | ||
</div> | ||
</Box> | ||
<div className="upload_input_inner"> | ||
<p className="white_text">ノートとタイトルと説明</p> | ||
<Box className="sentence_box"> | ||
<TextField label="ノートタイトル" helperText="(必須、40文字まで)" fullWidth inputProps={{ 'aria-label': 'description' }} className={classes.upload_input} /> | ||
<TextField label="説明(分野、工夫した点、特徴、注意点など)" helperText="(任意、1000文字まで)" fullWidth inputProps={{ 'aria-label': 'description' }} className={classes.upload_input} /> | ||
</Box> | ||
<p className="white_text">価格</p> | ||
<Box className="sentence_box"> | ||
<Input | ||
type="number" | ||
fullWidth | ||
endAdornment={<InputAdornment position="end">FUNney</InputAdornment>} | ||
className="input_number" | ||
/> | ||
</Box> | ||
</div> | ||
<div className="upload_button_space"> | ||
<div className="upload_button_inner"> | ||
<ColorButton | ||
variant="contained" | ||
onClick={moveToHome} | ||
> | ||
投稿する | ||
</ColorButton> | ||
<ColorButton | ||
variant="contained" | ||
className={classes.upload_button_bottom} | ||
onClick={moveToHome} | ||
> | ||
キャンセル | ||
</ColorButton> | ||
</div> | ||
</div> | ||
</div > | ||
) | ||
} | ||
export default withRouter(UploadPage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.positionFixed { | ||
position: fixed; | ||
right: 10px; | ||
bottom: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.upload_reset { | ||
background-color: #a9a9a9; | ||
height: 100vh; | ||
} | ||
|
||
.upload_margin { | ||
height: 3vh; | ||
background-color: #a9a9a9; | ||
} | ||
|
||
.upload_box { | ||
display: flex; | ||
flex-direction: column; | ||
height: 30vh; | ||
margin: 0 25%; | ||
background-color: white; | ||
} | ||
|
||
.upload_inner { | ||
margin: auto; | ||
} | ||
|
||
.upload_icon_bottom { | ||
display: block; | ||
font-size: 13px; | ||
color: black; | ||
margin: 0 auto; | ||
} | ||
|
||
.upload_input_inner { | ||
height: 30vh; | ||
} | ||
|
||
.white_text { | ||
display: block; | ||
color: white; | ||
margin-top: 1vh; | ||
margin-bottom: 0; | ||
} | ||
|
||
.sentence_box { | ||
background-color: white; | ||
padding: 0px 10px 10px 10px; | ||
} | ||
|
||
.input_number { | ||
padding-top: 10px; | ||
} | ||
|
||
.upload_button_space { | ||
margin-top: 15vh; | ||
height: 20vh; | ||
} | ||
|
||
.upload_button_inner { | ||
margin: 0% 15%; | ||
display: flex; | ||
flex-direction: column; | ||
} |