Skip to content

Commit

Permalink
fixed as per PR
Browse files Browse the repository at this point in the history
  • Loading branch information
syavaYki committed Sep 26, 2024
1 parent 10c268d commit b34fe4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/CommentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = {
export const CommentList: React.FC<Props> = ({ comments, onDelete }) => {
return (
<>
{comments && comments.length > 0 ? (
{comments.length > 0 ? (
comments.map(comment => {
return (
<CommentObj
Expand Down
8 changes: 4 additions & 4 deletions src/components/UserSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ type Props = {
export const UserSelector: React.FC<Props> = ({ users, onSelect }) => {
// region States
const [userSelect, setUserSelect] = useState<User | null>(null);
const [visibleList, setVisibleList] = useState(false);
const [visible, setVisible] = useState(false);
//endregion

// region Event handlers
const handleUserSelect = (user: User): void => {
setUserSelect(user);
setVisibleList(false);
setVisible(false);
onSelect(user);
};
//endregion
Expand All @@ -29,7 +29,7 @@ export const UserSelector: React.FC<Props> = ({ users, onSelect }) => {
className="button"
aria-haspopup="true"
aria-controls="dropdown-menu"
onClick={() => setVisibleList(prev => !prev)}
onClick={() => setVisible(prev => !prev)}
>
<span>{userSelect ? userSelect.name : 'Choose a user'}</span>

Expand All @@ -39,7 +39,7 @@ export const UserSelector: React.FC<Props> = ({ users, onSelect }) => {
</button>
</div>

{visibleList && (
{visible && (
<div className="dropdown-menu" id="dropdown-menu" role="menu">
<div className="dropdown-content">
{users.map(user => {
Expand Down

0 comments on commit b34fe4c

Please sign in to comment.