-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
16 changed files
with
166 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.ibexa-user-name { | ||
display: inline-flex; | ||
align-items: center; | ||
|
||
&__thumbnail { | ||
width: calculateRem(20px); | ||
height: calculateRem(20px); | ||
margin-right: calculateRem(8px); | ||
} | ||
|
||
&__text { | ||
white-space: nowrap; | ||
} | ||
|
||
.ibexa-user-thumbnail { | ||
vertical-align: initial; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.ibexa-user-thumbnail { | ||
&--img { | ||
width: calculateRem(24px); | ||
height: calculateRem(24px); | ||
width: calculateRem(20px); | ||
height: calculateRem(20px); | ||
border-radius: 50%; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -124,3 +124,4 @@ | |
@import 'summary-tile'; | ||
@import 'double-input-range'; | ||
@import 'switcher'; | ||
@import 'user-name'; |
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
7 changes: 7 additions & 0 deletions
7
src/bundle/Resources/public/scss/ui/modules/common/_user.name.scss
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 @@ | ||
.c-user-name { | ||
.c-thumbnail__image { | ||
width: calculateRem(20px); | ||
height: calculateRem(20px); | ||
border-radius: 50%; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/bundle/Resources/views/themes/admin/ui/component/user/user.html.twig
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,17 @@ | ||
<div class="ibexa-user-name"> | ||
<span class="ibexa-user-name__thumbnail"> | ||
{% include '@ibexadesign/ui/component/user_thumbnail/user_thumbnail.html.twig' with { | ||
user_content: user.content, | ||
user: user, | ||
attr_svg: { | ||
width: 20, | ||
height: 20, | ||
} | ||
} only %} | ||
</span> | ||
{% if user_path is defined %} | ||
<a href={{ user_path }} class="ibexa-user-name__text">{{ ibexa_content_name(user) }}</a> | ||
{% else %} | ||
<span class="ibexa-user-name__text">{{ ibexa_content_name(user) }}</span> | ||
{% endif %} | ||
</div> |
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
28 changes: 28 additions & 0 deletions
28
src/bundle/ui-dev/src/modules/common/user-name/user.name.js
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,28 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import Thumbnail from '../thumbnail/thumbnail'; | ||
|
||
const UserName = ({ name, thumbnail }) => { | ||
return ( | ||
<div className="c-user-name ibexa-user-name"> | ||
<span className="c-user-name__thumbnail ibexa-user-name__thumbnail"> | ||
<Thumbnail | ||
thumbnailData={{ mimeType: thumbnail.mimeType, resource: thumbnail.uri }} | ||
iconExtraClasses="ibexa-icon--small-medium" | ||
/> | ||
</span> | ||
<span className="c-user-name__text ibexa-user-name__text">{name}</span> | ||
</div> | ||
); | ||
}; | ||
|
||
UserName.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
thumbnail: PropTypes.shape({ | ||
mimeType: PropTypes.string.isRequired, | ||
uri: PropTypes.string.isRequired, | ||
}).isRequired, | ||
}; | ||
|
||
export default UserName; |
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