Browse Source

improvements to upload and style changes

master
Danilo Di Cuia 2 years ago
parent
commit
f85344e90b
  1. 2
      package.json
  2. 4
      public/manifest.json
  3. 24
      src/ImageUpload.js
  4. 1
      src/MyForm.js
  5. 3
      src/Proiezione.js

2
package.json

@ -30,7 +30,7 @@
] ]
}, },
"scripts": { "scripts": {
"go": "npm run build && rm ./build/video.mp4 && scp -r ./build danilo@enne2.net:www/letsswingchat/", "go": "npm run build && rm ./build/*.mp4 && scp -r ./build danilo@enne2.net:www/letsswingchat/",
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",

4
public/manifest.json

@ -1,6 +1,6 @@
{ {
"short_name": "React App", "short_name": "Chat Let's Swing!",
"name": "Create React App Sample", "name": "Chat Let's Swing!",
"icons": [ "icons": [
{ {
"src": "favicon.ico", "src": "favicon.ico",

24
src/ImageUpload.js

@ -66,22 +66,38 @@ function ImageUpload({ onImageURLSet, onImageUploading }) {
default: default:
case IDLE: case IDLE:
componente = ( componente = (
<> <Stack
style={{ justifyContent: "center", alignItems: "center" }}
direction="row"
>
<input <input
style={{ display: "none" }} style={{ display: "none" }}
id="raised-button-file" id="camera-input"
multiple multiple
type="file" type="file"
accept="image/*" accept="image/*"
capture="camera" capture="camera"
onChange={handleChange} onChange={handleChange}
/> />
<label htmlFor="raised-button-file"> <label htmlFor="camera-input">
<Button style={{ padding: 20, width: "100%" }} component="span">
scatta una foto
</Button>
</label>
<input
style={{ display: "none" }}
id="gallery-input"
multiple
type="file"
accept="image/*"
onChange={handleChange}
/>
<label htmlFor="gallery-input">
<Button style={{ padding: 20, width: "100%" }} component="span"> <Button style={{ padding: 20, width: "100%" }} component="span">
Aggiungi un'immagine Aggiungi un'immagine
</Button> </Button>
</label> </label>
</> </Stack>
); );
break; break;
case IMAGE_SET: case IMAGE_SET:

1
src/MyForm.js

@ -20,6 +20,7 @@ export const MyForm = () => {
keepValues: false, keepValues: false,
}); });
setMandato(true); setMandato(true);
cambiaimmagineURL(null);
var postListRef = firebase.database().ref(`messaggi/${evento}`); var postListRef = firebase.database().ref(`messaggi/${evento}`);
var newPostRef = postListRef.push(); var newPostRef = postListRef.push();
const update = { const update = {

3
src/Proiezione.js

@ -184,10 +184,9 @@ const Messaggio = ({ messaggiApprovati }) => {
}; };
export const VideoComponent = React.memo(() => { export const VideoComponent = React.memo(() => {
console.log("asdf");
return ( return (
<video autoPlay muted loop id="myVideo"> <video autoPlay muted loop id="myVideo">
<source src={process.env.PUBLIC_URL + "/video.mp4"} type="video/mp4" /> <source src={"/video.mp4"} type="video/mp4" />
</video> </video>
); );
}); });

Loading…
Cancel
Save