File tree 9 files changed +88
-6
lines changed
9 files changed +88
-6
lines changed Original file line number Diff line number Diff line change 12
12
13
13
# misc
14
14
.DS_Store
15
+ .env
15
16
.env.local
16
17
.env.development.local
17
18
.env.test.local
Original file line number Diff line number Diff line change 1
1
import React , { Component } from "react" ;
2
2
import { Link } from "react-router-dom" ;
3
3
import axios from 'axios' ;
4
+ import PropTypes from 'prop-types' ;
5
+ import { withStyles } from '@material-ui/core/styles' ;
6
+ import Icon from '@material-ui/core/Icon' ;
7
+ import IconButton from '@material-ui/core/IconButton' ;
8
+ import DeleteIcon from '@material-ui/icons/Delete' ;
9
+ import AddShoppingCartIcon from '@material-ui/icons/AddShoppingCart' ;
10
+ import PhotoCamera from '@material-ui/icons/PhotoCamera' ;
11
+ import CameraButton from "../PhotoButton" ;
12
+
13
+ const styles = theme => ( {
14
+ button : {
15
+ margin : theme . spacing . unit ,
16
+ } ,
17
+ input : {
18
+ display : 'none' ,
19
+ } ,
20
+ } ) ;
4
21
5
22
class AddPhotoS3 extends Component {
6
23
constructor ( props ) {
@@ -60,8 +77,16 @@ class AddPhotoS3 extends Component{
60
77
< input
61
78
type = "file"
62
79
name = "selectedFile"
80
+ id = "file-input"
63
81
onChange = { this . onChange }
82
+ className = ""
64
83
/>
84
+ { /* <CameraButton
85
+ type="file"
86
+ name="selectedFile"
87
+ id="file-input"
88
+ onChange={this.onChange}/> */ }
89
+ < br />
65
90
< br />
66
91
< input
67
92
type = "text"
@@ -71,7 +96,8 @@ class AddPhotoS3 extends Component{
71
96
onChange = { this . onChange }
72
97
/>
73
98
< br />
74
- < button type = "submit" > Submit</ button >
99
+ < br />
100
+ < button type = "submit" className = "btn btn-success" > Submit</ button >
75
101
</ form >
76
102
77
103
Original file line number Diff line number Diff line change
1
+ import React , { Component } from "react" ;
2
+ import { Link } from "react-router-dom" ;
3
+ import axios from 'axios' ;
4
+
5
+ import PropTypes from 'prop-types' ;
6
+ import { withStyles } from '@material-ui/core/styles' ;
7
+ import Icon from '@material-ui/core/Icon' ;
8
+ import IconButton from '@material-ui/core/IconButton' ;
9
+ import DeleteIcon from '@material-ui/icons/Delete' ;
10
+ import AddShoppingCartIcon from '@material-ui/icons/AddShoppingCart' ;
11
+ import PhotoCamera from '@material-ui/icons/PhotoCamera' ;
12
+
13
+ const styles = theme => ( {
14
+ button : {
15
+ margin : theme . spacing . unit ,
16
+ } ,
17
+ input : {
18
+ display : 'none' ,
19
+ } ,
20
+ } ) ;
21
+
22
+ function PhotoButton ( props ) {
23
+ const { classes } = props ;
24
+ return (
25
+ < div >
26
+
27
+ < input accept = "image/*" className = { classes . input } id = "icon-button-file" type = "file" name = "selectedFile" />
28
+ < label htmlFor = "icon-button-file" >
29
+ < IconButton color = "primary" className = { classes . button } component = "span" size = "large" >
30
+ < PhotoCamera />
31
+ </ IconButton >
32
+ </ label >
33
+ </ div >
34
+ ) ;
35
+ }
36
+
37
+ PhotoButton . propTypes = {
38
+ classes : PropTypes . object . isRequired ,
39
+ } ;
40
+
41
+ const CameraButton = withStyles ( styles ) ( PhotoButton ) ;
42
+
43
+ export default CameraButton ;
Original file line number Diff line number Diff line change
1
+ export { default } from "./PhotoButton" ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import TitleBar from "../../components/TitleBar";
5
5
import EndButton from "../../components/EndButton" ;
6
6
import AddPhotoS3 from "../../components/AddPhotoS3" ;
7
7
import AddTextorPhoto from "../../components/AddTextorPhoto" ;
8
+ import CameraButton from "../../components/PhotoButton" ;
8
9
9
10
class ChooseContentType extends Component {
10
11
state = {
@@ -37,14 +38,18 @@ class ChooseContentType extends Component {
37
38
< div >
38
39
< div className = "wrapper" >
39
40
< TitleBar />
40
- < AddTextorPhoto />
41
+ { /* <AddTextorPhoto /> */ }
41
42
< br > </ br >
42
43
< p > Story Name: { this . state . story . title } </ p >
43
44
< AddPhotoS3
44
45
key = { this . state . story . id }
45
46
storyId = { this . state . story . id }
46
47
title = { this . state . story . title }
47
- />
48
+
49
+ >
50
+
51
+ </ AddPhotoS3 >
52
+
48
53
</ div >
49
54
< div >
50
55
< EndButton
Original file line number Diff line number Diff line change 1
1
{
2
2
"development" : {
3
3
"username" : " root" ,
4
- "password" : " root " ,
4
+ "password" : " " ,
5
5
"database" : " story_db" ,
6
6
"host" : " 127.0.0.1" ,
7
7
"dialect" : " mysql"
Original file line number Diff line number Diff line change 22
22
"aws-sdk" : " ^2.238.1" ,
23
23
"axios" : " ^0.18.0" ,
24
24
"cors" : " ^2.8.4" ,
25
+ "dotenv" : " ^5.0.1" ,
25
26
"express" : " ^4.15.4" ,
26
27
"express-session" : " ^1.15.6" ,
27
28
"multer" : " ^1.3.0" ,
Original file line number Diff line number Diff line change
1
+ require ( 'dotenv' ) . config ( ) ;
1
2
const express = require ( 'express' ) ;
2
3
var router = express . Router ( ) ;
3
4
var AWS = require ( 'aws-sdk' ) ;
@@ -7,8 +8,8 @@ var db = require("../models");
7
8
8
9
//AWS
9
10
//aws keys
10
- var accessKeyId = process . env . AWS_ACCESS_KEY || "AKIAJSQNCM5K6YOIRMPA" ;
11
- var secretAccessKey = process . env . AWS_SECRET_KEY || "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" ;
11
+ var accessKeyId = process . env . aws_access_key_id ;
12
+ var secretAccessKey = process . env . aws_secret_access_key ;
12
13
AWS . config . update ( {
13
14
accessKeyId : accessKeyId ,
14
15
secretAccessKey : secretAccessKey
Original file line number Diff line number Diff line change @@ -641,6 +641,10 @@ dot-prop@^4.1.0:
641
641
dependencies :
642
642
is-obj "^1.0.0"
643
643
644
+ dotenv@^5.0.1 :
645
+ version "5.0.1"
646
+ resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
647
+
644
648
dottie@^2.0.0 :
645
649
version "2.0.0"
646
650
resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.0.tgz#da191981c8b8d713ca0115d5898cf397c2f0ddd0"
You can’t perform that action at this time.
0 commit comments