-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mingze Xiao
committed
May 14, 2020
1 parent
1d7e145
commit eb20b7f
Showing
11 changed files
with
384 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import '~box-ui-elements/es/styles/variables'; | ||
|
||
.ba-DefaultItemRow-email { | ||
color: $bdl-gray-62; | ||
font-size: 11px; | ||
line-height: 13px; | ||
} |
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,31 @@ | ||
import React from 'react'; | ||
import DatalistItem from 'box-ui-elements/es/components/datalist-item'; | ||
import { UserMini, GroupMini } from '../../../@types'; | ||
import './ItemRow.scss'; | ||
|
||
export type Props = { | ||
id?: string; | ||
item?: UserMini | GroupMini; | ||
name?: string; | ||
}; | ||
|
||
const DefaultItemRow = ({ item, ...rest }: Props): JSX.Element | null => { | ||
if (!item || !item.name) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<DatalistItem {...rest}> | ||
<div className="ba-DefaultItemRow-name" data-testid="ba-DefaultItemRow-name"> | ||
{item.name} | ||
</div> | ||
{'email' in item && ( | ||
<div className="ba-DefaultItemRow-email" data-testid="ba-DefaultItemRow-email"> | ||
{item.email} | ||
</div> | ||
)} | ||
</DatalistItem> | ||
); | ||
}; | ||
|
||
export default DefaultItemRow; |
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
Oops, something went wrong.