-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a dialog pop to display the LargePortraitCard.
- Loading branch information
1 parent
7a9f947
commit 4a056b3
Showing
9 changed files
with
724 additions
and
149 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,70 @@ | ||
import React from "react"; | ||
import { | ||
BrowserRouter as Router, | ||
Route, | ||
Switch, | ||
useHistory, | ||
} from "react-router-dom"; | ||
import { useState } from "react"; | ||
import LargePortraitCard from "./LargePortraitCard"; | ||
import { SmallPortraitCard } from "./SmallPortraitCard"; | ||
|
||
const modalOverlay = { | ||
position: "fixed", | ||
top: "0", | ||
left: "0", | ||
right: "0", | ||
bottom: "0", | ||
backgroundColor: "rgba(0, 0, 0, 0.3)", | ||
zIndex: 1000 | ||
}; | ||
const modalContent = { | ||
position: "fixed", | ||
top: "50%", | ||
left: "50%", | ||
transform: "translate(-50%, -50%)", | ||
padding: "20px", | ||
backgroundColor: "var(--ifm-color-primary-p0)", | ||
border: "1px solid #ccc", | ||
boxShadow: "0 8px 16px rgba(0,0,0,0.2)", | ||
borderRadius: "10px", | ||
zIndex: "4000" | ||
}; | ||
|
||
export default function PortraitCardsAnchorAndDialog({ person }) { | ||
const history = useHistory(); | ||
let [isDialogOpen, setIsDialogOpen] = useState(true); | ||
return ( | ||
<Router> | ||
<div> | ||
<SmallPortraitCard person={person} /> | ||
<Switch> | ||
<Route | ||
path={"/about/" + person.firstName} | ||
render={() => ( | ||
<> | ||
<div style={modalOverlay}> | ||
<div style={modalContent}> | ||
<button | ||
className="close-button" | ||
style={{ | ||
position: "absolute", | ||
top: "10px", | ||
right: "10px", | ||
}} | ||
onClick={() => { | ||
history.goBack(); | ||
setIsDialogOpen(false); | ||
}} | ||
/> | ||
<LargePortraitCard person={person} /> | ||
</div> | ||
</div> | ||
</> | ||
)} | ||
/> | ||
</Switch> | ||
</div> | ||
</Router> | ||
); | ||
} |
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
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,12 @@ | ||
import LargePortraitCard from "@site/src/components/about/LargePortraitCard"; | ||
import { leadershipTeam } from "@site/src/components/about/Team/team"; | ||
//import PortraitDialog from "@site/src/components/about/PortraitDialog"; | ||
|
||
export default function SylvainComponent() { | ||
/*leadershipTeam.forEach((person) => { | ||
if (person.firstName === "Sylvain") | ||
console.log('Found') | ||
return <LargePortraitCard person={person} />; | ||
});*/ | ||
<div> This is great</div> | ||
} |
Oops, something went wrong.