Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Create a textinput component #39

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rachaelch3n
Copy link
Contributor

What's new in this PR 🧑‍🌾

Description

  • Created a TextInput component that highlights the border of the active input field in green.
  • Used the TextInput component to style the input fields on the login and sign-up pages.
  • Styled the login and sign-up pages.

Screenshots

Styled Log In and Sign Up pages
Screen Shot 2024-11-12 at 6 22 51 PM
Screen Shot 2024-11-12 at 6 22 09 PM

Selected Input
Screen Shot 2024-11-12 at 6 24 28 PM

How to review

  • Review components/TextInput and components/styles files
  • Review /login and /signup pages

Next steps

  • styling the buttons
  • handling what occurs when a user is already signed in

Relevant links

Online sources

Related PRs

CC: @ccatherinetan

Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking great so far!! tysm rachael! 🤩
some comments

  1. make sure u import colors from figma into the styles/colors.ts folder!
  2. import the show/hide icon from figma and use absolute positioning to place it on top of the input (see my comment)
  3. we should merge in auth context and confirm password asap and rebase before merging this!

font-size: 1rem;
font-weight: 500;
margin-bottom: 0.5rem;
color: darkgreen;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure you use the custom colors from figma. you can find this by going on dev mode and getting the hex code. Then, add the color to the styles/colors.ts folder and import it into this file and access the color here using

color: ${COLORS.darkGreen}

transition: border-color 0.3s ease;

&:focus {
border-color: green;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flagging the color comment!

Comment on lines +43 to +51
{type === 'password' && toggleVisibility && (
<button
type="button"
onClick={toggleVisibility}
style={{
marginBottom: '10px',
}}
>
{isVisible ? 'Hide' : 'Show'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to import the Show and Hide icons from figma and add it to the project. in order to be consistent with the designs, this should also appear inside the Input bar.
Screen Shot 2024-11-12 at 7 01 05 PM

To achieve this, chatGPT suggested this:

  1. Wrap the input and the button in a container.
  2. Use absolute positioning on the button to place it inside the input field on the right side.

you'll prob need to make some edits like this

const InputWrapper = styled.div`
  position: relative;
  width: 100%;
`;
const ShowHideButton = styled.button`
  position: absolute;
  right: 10px; // or whatever it is
  top: 50%; // this line and...
  transform: translateY(-50%); // this line help center the Button within input box
  cursor: pointer;
`;

@ccatherinetan ccatherinetan linked an issue Nov 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a TextInput Component
2 participants