-
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 branch 'next' into task/OV-5-JWT-token
- Loading branch information
Showing
47 changed files
with
848 additions
and
98 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
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,3 @@ | ||
export { FormError } from './form-error/form-error.js'; | ||
export { FormHeader } from './form-header/form-header.js'; | ||
export { PasswordInput } from './password-input/password-input.js'; |
19 changes: 19 additions & 0 deletions
19
frontend/src/bundles/auth/components/common/form-error/form-error.tsx
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,19 @@ | ||
import { | ||
FormControl, | ||
FormErrorMessage, | ||
} from '~/bundles/common/components/components.js'; | ||
|
||
type Properties = { | ||
isVisible: boolean; | ||
message: string; | ||
}; | ||
|
||
const FormError: React.FC<Properties> = ({ isVisible, message }) => { | ||
return ( | ||
<FormControl isInvalid={isVisible}> | ||
<FormErrorMessage>{message}</FormErrorMessage> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export { FormError }; |
23 changes: 23 additions & 0 deletions
23
frontend/src/bundles/auth/components/common/form-header/form-header.tsx
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,23 @@ | ||
import { Heading, Text } from '~/bundles/common/components/components.js'; | ||
|
||
type Properties = { | ||
headerText: string; | ||
subheader: React.ReactNode; | ||
}; | ||
|
||
const FormHeader: React.FC<Properties> = ({ headerText, subheader }) => { | ||
return ( | ||
<> | ||
{/* TODO: Add logo */} | ||
<h2 style={{ marginBottom: '50px' }}>LOGO</h2> | ||
<Heading as="h1" color="white" mb="6px" fontSize="30px"> | ||
{headerText} | ||
</Heading> | ||
<Text mb="24px" fontSize="14px"> | ||
{subheader} | ||
</Text> | ||
</> | ||
); | ||
}; | ||
|
||
export { FormHeader }; |
49 changes: 49 additions & 0 deletions
49
frontend/src/bundles/auth/components/common/password-input/password-input.tsx
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,49 @@ | ||
import { | ||
IconButton, | ||
Input, | ||
InputGroup, | ||
InputRightElement, | ||
ViewIcon, | ||
ViewOffIcon, | ||
} from '~/bundles/common/components/components.js'; | ||
import { useCallback, useState } from '~/bundles/common/hooks/hooks.js'; | ||
|
||
type Properties = { | ||
label: string; | ||
name: string; | ||
hasError: boolean; | ||
}; | ||
|
||
const PasswordInput: React.FC<Properties> = ({ label, name, hasError }) => { | ||
const [isPasswordVisible, setIsPasswordVisible] = useState<boolean>(false); | ||
|
||
const handlePasswordIconClick = useCallback((): void => { | ||
setIsPasswordVisible( | ||
(previousIsPasswordVisible) => !previousIsPasswordVisible, | ||
); | ||
}, []); | ||
|
||
return ( | ||
<InputGroup size="md"> | ||
<Input | ||
type={isPasswordVisible ? 'text' : 'password'} | ||
label={label} | ||
placeholder="••••••••" | ||
name={name} | ||
icon="right" | ||
/> | ||
<InputRightElement top="unset" bottom={hasError ? '25px' : 0}> | ||
<IconButton | ||
aria-label={ | ||
isPasswordVisible ? 'Hide password' : 'Show password' | ||
} | ||
icon={isPasswordVisible ? <ViewIcon /> : <ViewOffIcon />} | ||
onClick={handlePasswordIconClick} | ||
variant="ghostIcon" | ||
/> | ||
</InputRightElement> | ||
</InputGroup> | ||
); | ||
}; | ||
|
||
export { PasswordInput }; |
8 changes: 8 additions & 0 deletions
8
frontend/src/bundles/auth/components/sign-in-form/constants/constants.ts
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,8 @@ | ||
import { type UserSignInRequestDto } from '~/bundles/users/users.js'; | ||
|
||
const DEFAULT_SIGN_IN_PAYLOAD: UserSignInRequestDto = { | ||
email: '', | ||
password: '', | ||
}; | ||
|
||
export { DEFAULT_SIGN_IN_PAYLOAD }; |
Oops, something went wrong.