Skip to content

Commit

Permalink
temporary solution for href
Browse files Browse the repository at this point in the history
  • Loading branch information
harshsbhat committed Dec 26, 2024
1 parent 871dba9 commit fa3eaff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/components/controlModals/create-new-site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function CreateNewSite({ params }: CreateSiteProps) {
const [passwordMatch, setPasswordMatch] = React.useState(true);
const [siteCreated, setSiteCreated] = React.useState(false);
const initHash = sha256("");
const handleCancel = () => {
window.location.href = "/"
};

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
Expand Down Expand Up @@ -110,11 +113,9 @@ export function CreateNewSite({ params }: CreateSiteProps) {
</div>
<div className="mt-4 flex gap-2">
<Button type="submit">Create</Button>
<Link href="/" passHref={true}>
<Button type="button" variant="outline">
<Button type="button" variant="outline" onClick={handleCancel}>
Cancel
</Button>
</Link>

</div>
</form>
Expand Down
8 changes: 4 additions & 4 deletions src/components/controlModals/decrypt-old-site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function DecryptSite({ params, encryptedData }: DecryptProps) {
const [decryptedData, setDecryptedData] = React.useState<string | null>(null);
const [initHash, setInitHash] = React.useState<string | null>(null);
const [error, setError] = React.useState<string | null>(null);

const handleCancel = () => {
window.location.href = "/"
};
const handleSubmit = async () => {
setError(null);
setDecryptedData(null);
Expand Down Expand Up @@ -79,9 +81,7 @@ export function DecryptSite({ params, encryptedData }: DecryptProps) {
</div>
<div className="flex gap-2 mt-4">
<Button type="submit" >Decrypt</Button>
<Link href="/" passHref={true}>
<Button type="button" variant="outline">Cancel</Button>
</Link>
<Button type="button" variant="outline" onClick={handleCancel}>Cancel</Button>
</div>
</form>
</CardContent>
Expand Down

0 comments on commit fa3eaff

Please sign in to comment.