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

fix(frontend): user invite UI on Mobile #2586

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
align-items: center;
justify-content: space-between;
gap: Spacings.$spacing05;
max-width: 100%;

.selector {
width: 300px;
}

@media (max-width: ScreenSizes.$small) {
display: flex;
flex-direction: column;

.selector {
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useEffect, useState } from "react";

import Icon from "@/lib/components/ui/Icon/Icon";

import styles from "./UserToInvite.module.scss";

import { SingleSelector } from "../../../../../../../../../lib/components/ui/SingleSelector/SingleSelector";
Expand Down Expand Up @@ -43,16 +41,21 @@ export const UserToInvite = ({

return (
<div className={styles.user_to_invite_wrapper}>
<Icon
color="dangerous"
name="delete"
handleHover={true}
size="normal"
onClick={removeCurrentInvitation}
<TextInput
label="Email"
inputValue={email}
setInputValue={setEmail}
onKeyDown={(event) => {
if (
event.key === "Backspace" &&
removeCurrentInvitation &&
!email.length
) {
removeCurrentInvitation();
}
}}
/>

<TextInput label="Email" inputValue={email} setInputValue={setEmail} />

<div className={styles.selector}>
<SingleSelector
selectedOption={{ label: selectedRole, value: selectedRole }}
Expand Down
3 changes: 3 additions & 0 deletions frontend/lib/components/ui/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type TextInputProps = {
onSubmit?: () => void;
disabled?: boolean;
crypted?: boolean;
onKeyDown?: (event: React.KeyboardEvent) => void;
};

export const TextInput = ({
Expand All @@ -22,6 +23,7 @@ export const TextInput = ({
onSubmit,
disabled,
crypted,
onKeyDown,
}: TextInputProps): JSX.Element => {
return (
<div
Expand All @@ -41,6 +43,7 @@ export const TextInput = ({
if (e.key === "Enter" && onSubmit) {
onSubmit();
}
onKeyDown?.(e);
}}
/>
{!simple && iconName && (
Expand Down