-
Notifications
You must be signed in to change notification settings - Fork 1
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 #6 from EnjoyBacon7/dev
Dev
- Loading branch information
Showing
8 changed files
with
81 additions
and
32 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
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,31 @@ | ||
// System imports | ||
import React, { useState } from "react"; | ||
import { useNavigate, useParams } from "react-router-dom"; | ||
import Form from "react-bootstrap/Form"; | ||
|
||
export function CbShareSearch() { | ||
|
||
// Useful hooks | ||
const [shareId, setShareId] = useState(useParams().shareId); | ||
const navigate = useNavigate(); | ||
|
||
// Evaluate entered shareId | ||
function handleChange(e) { | ||
setShareId(e.target.value); | ||
} | ||
|
||
// Redirect on submit | ||
function handleRedirect() { | ||
navigate(`/share/${encodeURIComponent(shareId)}`); | ||
} | ||
|
||
return ( | ||
<Form className="mt-3" onChange={handleChange} onSubmit={handleRedirect}> | ||
<Form.Group> | ||
<Form.Control type="text" placeholder="Enter Share ID to Retrieve an Existing Share" /> | ||
</Form.Group> | ||
</Form> | ||
) | ||
} | ||
|
||
export default CbShareSearch; |
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