-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
096fce8
commit cc8cb00
Showing
2 changed files
with
74 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { useState } from 'react'; | ||
import { RiPencilFill } from "react-icons/ri"; | ||
import Modal from "@/common/ui/components/Modal"; | ||
|
||
export default function Gallery() { | ||
|
||
const images = ["image1","image2","image3"] | ||
|
||
const [editMode, setMode] = useState(false); | ||
const [imageURL, setImageURL] = useState("https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80"); | ||
|
||
function switchMode() { | ||
setMode(!editMode); | ||
} | ||
|
||
const handleSubmit = (event) => { | ||
const formData = new FormData(event.currentTarget); | ||
event.preventDefault(); | ||
setImageURL(formData.get("URL")); | ||
switchMode(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className ="row-span-4 col-span-4 rounded-md flex items-center justify-center overflow-hidden relative"> | ||
<img | ||
src={`${imageURL}?${new Date().getTime()}`} | ||
className = "inset-0 bg-cover bg-center z-0" | ||
/> | ||
<div className = "opacity-0 hover:opacity-100 duration-500 absolute inset-0 z-10 flex bg-slate-400 bg-opacity-50"> | ||
<button onClick={switchMode} className = "opacity-0 hover:opacity-100 duration-500 absolute inset-0 z-10 flex justify-center items-center text-white font-semibold text-4xl"> | ||
<RiPencilFill /> | ||
</button> | ||
</div> | ||
</div> | ||
<Modal | ||
open={editMode} | ||
setOpen={setMode} | ||
> | ||
<form onSubmit={handleSubmit}> | ||
<label> | ||
<h2 className = "m-2">URL</h2> | ||
<input name="URL" type="text" className = "p-2 m-2"/> | ||
</label> | ||
<br/> | ||
<button type="submit" className = "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 m-2 rounded"> | ||
Update | ||
</button> | ||
</form> | ||
</Modal> | ||
</> | ||
) | ||
} |
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,21 @@ | ||
import Space from "@/common/ui/templates/space"; | ||
import Feed from "../feed"; | ||
import { useAccountStore } from "@/common/data/stores/useAccountStore"; | ||
|
||
function retrieveConfig(user, space){ | ||
const fidgetConfigs = {}; | ||
const layoutConfig = {} | ||
const layoutID = ""; | ||
|
||
return ({fidgetConfigs, layoutConfig, layoutID}) | ||
} | ||
|
||
export default function Homebase(spaceID) { | ||
|
||
//const { getCurrentUser } = useAccountStore(); | ||
const user = useAccountStore.getState().accounts[0]; | ||
|
||
return ( | ||
<Space config={retrieveConfig(user, spaceID)} isEditable={true}></Space> | ||
) | ||
} |