| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -2,24 +2,24 @@ import { Input, Modal, Note, Spacer } from "@geist-ui/core"
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import { useState } from "react"
 | 
					 | 
					 | 
					 | 
					import { useState } from "react"
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					type Props = {
 | 
					 | 
					 | 
					 | 
					type Props = {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    warning?: boolean
 | 
					 | 
					 | 
					 | 
					    creating?: boolean
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    isOpen: boolean
 | 
					 | 
					 | 
					 | 
					    isOpen: boolean
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    onClose: () => void
 | 
					 | 
					 | 
					 | 
					    onClose: () => void
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    onSubmit: (password: string) => void
 | 
					 | 
					 | 
					 | 
					    onSubmit: (password: string) => void
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					const PasswordModal = ({ isOpen, onClose, onSubmit: onSubmitAfterVerify, warning }: Props) => {
 | 
					 | 
					 | 
					 | 
					const PasswordModal = ({ isOpen, onClose, onSubmit: onSubmitAfterVerify, creating }: Props) => {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const [password, setPassword] = useState<string>()
 | 
					 | 
					 | 
					 | 
					    const [password, setPassword] = useState<string>()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const [confirmPassword, setConfirmPassword] = useState<string>()
 | 
					 | 
					 | 
					 | 
					    const [confirmPassword, setConfirmPassword] = useState<string>()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const [error, setError] = useState<string>()
 | 
					 | 
					 | 
					 | 
					    const [error, setError] = useState<string>()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const onSubmit = () => {
 | 
					 | 
					 | 
					 | 
					    const onSubmit = () => {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (!password || !confirmPassword) {
 | 
					 | 
					 | 
					 | 
					        if (!password || (creating && !confirmPassword)) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            setError('Please enter a password')
 | 
					 | 
					 | 
					 | 
					            setError('Please enter a password')
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return
 | 
					 | 
					 | 
					 | 
					            return
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (password !== confirmPassword) {
 | 
					 | 
					 | 
					 | 
					        if (password !== confirmPassword && creating) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            setError("Passwords do not match")
 | 
					 | 
					 | 
					 | 
					            setError("Passwords do not match")
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return
 | 
					 | 
					 | 
					 | 
					            return
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -31,7 +31,7 @@ const PasswordModal = ({ isOpen, onClose, onSubmit: onSubmitAfterVerify, warning
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {<Modal visible={isOpen} >
 | 
					 | 
					 | 
					 | 
					        {<Modal visible={isOpen} >
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            <Modal.Title>Enter a password</Modal.Title>
 | 
					 | 
					 | 
					 | 
					            <Modal.Title>Enter a password</Modal.Title>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            <Modal.Content>
 | 
					 | 
					 | 
					 | 
					            <Modal.Content>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                {!error && warning && <Note type="warning" label='Warning'>
 | 
					 | 
					 | 
					 | 
					                {!error && creating && <Note type="warning" label='Warning'>
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    This doesn't protect your post from the server administrator.
 | 
					 | 
					 | 
					 | 
					                    This doesn't protect your post from the server administrator.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                </Note>}
 | 
					 | 
					 | 
					 | 
					                </Note>}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                {error && <Note type="error" label='Error'>
 | 
					 | 
					 | 
					 | 
					                {error && <Note type="error" label='Error'>
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -39,7 +39,7 @@ const PasswordModal = ({ isOpen, onClose, onSubmit: onSubmitAfterVerify, warning
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                </Note>}
 | 
					 | 
					 | 
					 | 
					                </Note>}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                <Spacer />
 | 
					 | 
					 | 
					 | 
					                <Spacer />
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                <Input width={"100%"} label="Password" marginBottom={1} htmlType="password" placeholder="Password" onChange={(e) => setPassword(e.target.value)} />
 | 
					 | 
					 | 
					 | 
					                <Input width={"100%"} label="Password" marginBottom={1} htmlType="password" placeholder="Password" onChange={(e) => setPassword(e.target.value)} />
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                <Input width={"100%"} label="Confirm" htmlType="password" placeholder="Confirm Password" onChange={(e) => setConfirmPassword(e.target.value)} />
 | 
					 | 
					 | 
					 | 
					                {creating && <Input width={"100%"} label="Confirm" htmlType="password" placeholder="Confirm Password" onChange={(e) => setConfirmPassword(e.target.value)} />}
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            </Modal.Content>
 | 
					 | 
					 | 
					 | 
					            </Modal.Content>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            <Modal.Action passive onClick={onClose}>Cancel</Modal.Action>
 | 
					 | 
					 | 
					 | 
					            <Modal.Action passive onClick={onClose}>Cancel</Modal.Action>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            <Modal.Action onClick={onSubmit}>Submit</Modal.Action>
 | 
					 | 
					 | 
					 | 
					            <Modal.Action onClick={onSubmit}>Submit</Modal.Action>
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |