generated from WildCodeSchool/create-js-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #79 from WildCodeSchool-2023-09/dev
Dev
- Loading branch information
Showing
22 changed files
with
564 additions
and
84 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 +1,8 @@ | ||
import Home from "./pages/Home"; | ||
import { Outlet } from "react-router-dom"; | ||
import "./styles/commons.scss"; | ||
|
||
function App() { | ||
return <Home />; | ||
return <Outlet />; | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
import React, { useState } from "react"; | ||
import CameraReact from "react-html5-camera-photo"; | ||
import "react-html5-camera-photo/build/css/index.css"; | ||
import CameraSVG from "../assets/Camera.svg"; | ||
import "./Camera.scss"; | ||
|
||
function Camera() { | ||
const [isCameraOpen, setIsCameraOpen] = useState(false); | ||
|
||
const handleTakePhoto = (dataUri) => { | ||
// Faites quelque chose avec l'image capturée, par exemple, affichez-la ou téléchargez-la. | ||
console.info(dataUri); | ||
setIsCameraOpen(false); | ||
}; | ||
|
||
const openCamera = () => { | ||
setIsCameraOpen(true); | ||
}; | ||
|
||
const closeCamera = () => { | ||
setIsCameraOpen(false); | ||
}; | ||
|
||
return ( | ||
<div> | ||
{isCameraOpen ? ( | ||
<div> | ||
<CameraReact onTakePhoto={handleTakePhoto} isFullscreen /> | ||
<button type="button" onClick={closeCamera}> | ||
Fermer la caméra | ||
</button> | ||
</div> | ||
) : ( | ||
<div> | ||
<button | ||
className="camera-button" | ||
type="button" | ||
onClick={openCamera} | ||
onKeyDown={openCamera} | ||
style={{ cursor: "pointer" }} | ||
> | ||
<img src={CameraSVG} alt="Camera icon" className="Camera-Icon" /> | ||
</button> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default Camera; |
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,17 @@ | ||
@import "../styles/commons.scss"; | ||
|
||
.camera-button { | ||
background: none; | ||
border: none; | ||
padding: 0; | ||
margin: 0; | ||
font: inherit; | ||
cursor: pointer; | ||
outline: inherit; | ||
} | ||
|
||
.Camera-Icon { | ||
width: 20vw; | ||
margin-bottom: 30vh; | ||
background-color: $deep-purple; | ||
} |
Oops, something went wrong.